Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8120841

MemoryLeak in javafx.scene.controls.MenuBar

XMLWordPrintable

      There is a memory leak in javafx.scene.controls.MenuBar even they are not referenced from root group anymore.
      The simplified test case (MenuBarMemLeakTest.java) which clears root group and then creates new MenuBar on every pulse
      demonstrates this. Running the test with heap size 32Mb fails with OutOfMemory after 701 iterations.

      Steps to run the test:
      > javac -cp ... MenuBarMemLeakTest.java
      > java -Xmx32m MenuBarMemLeakTest

      GC root path for MenuBar is the following:

      Class Name | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
      -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      java.lang.Thread @ 0x314b0930 JavaFX-Launcher Thread | 1 | 104 | 344 | 200
      '- <Java Local> MenuBarMemLeakTest @ 0x314b0b08 | 1 | 32 | 344 | 32
         '- stage javafx.stage.Stage @ 0x314d24f0 | 1 | 144 | 344 | 15,128
            '- focused javafx.stage.Window$3 @ 0x314dea90 | 1 | 40 | 344 | 14,176
               '- readOnlyProperty javafx.beans.property.ReadOnlyBooleanWrapper$ReadOnlyPropertyImpl @ 0x314eb980| 1 | 16 | 344 | 14,136
                  '- helper com.sun.javafx.binding.ExpressionHelper$Generic @ 0x31561da0 | 1 | 40 | 344 | 14,120
                     '- changeListeners javafx.beans.value.ChangeListener[709] @ 0x328f9f10 | 1 | 2,848 | 344 | 14,064
                        '- [361] com.sun.javafx.scene.control.skin.MenuBarSkin$5 @ 0x329d9380 | 1 | 16 | 344 | 16
                           '- this$0 com.sun.javafx.scene.control.skin.MenuBarSkin @ 0x329ef988 | 1 | 432 | 344 | 3,368
                              '- control javafx.scene.control.MenuBar @ 0x329ef830 | 1 | 344 | 344 | 2,544
      -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      This issue leads to Ensemble2AutoTest reliability test to fail with OOM in few hours.

       

            psomashe Parvathi Somashekar (Inactive)
            epavlova Ekaterina Pavlova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: