Uploaded image for project: 'Activation'
  1. Activation
  2. MGNLACTIVATION-121

Prevent memory leak of temp files references at activation transporter

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.4.3
    • 5.4.2

    Description

      We have found a memory leak problem with the temporary activation files on Magnolia 4.4.4.

      Two conditions are required to trigger the problem :

      • The Magnolia server is not restarted during a long time (a few weeks)
      • A lot of content is activated continuously

      After some time, the Magnolia Author get really slow until it does not respond anymore and client restart it.
      We have investigated this problem for some time, first we have lower down the Xmx so outOfMemory error could be throw, and we have configure the JVM to perform heapDump on outOfMemory error.

      We got our hand on a heapDump last week and we found that most of the memory where occupy by a large map hold by "java.io.DeleteOnExitHook" that is referencing temporary files created by Magnolia (about 200 000 references)

      We found the origin of this leak, in the magnolia-exchange-activation-module, version 4.4.4, there is a class named "Transporter" with a method "prepareTempFile". The temporary activation files are created in the method and are referenced to be deleted when the JVM terminates (Method deleteOnExit of File class) and these refereces are not deleted when the file is deleted by Magnolia.
      This problem is referenced in sereral threads (http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6664633, http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4872014, http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4809375)

      We are going to correct this problem by removing the deleteOnExit call on the temp file.

      But in the activation module version 5.4.2, we can see that the method prepareTempFile in the ActivationContent class still call the method "tempFile.deleteOnExit();" (line 82), and as far as we know, this problem with the method "deleteOnExit" is still present in more recent versions of the JVM (7 or 8).

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              efochr Evzen Fochr
              nbarithel Nicolas Barithel
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD