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

Memory leak in JavaFX WebView

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 8u102, 9
    • javafx
    • web
    • generic
    • generic
    • Fix failed

      There is a memory leak in native code of JavaFX WebView of most recent JDK1.8.0 (tested on u112) related to Java/JavaScript interop. Probably releated to usage of

      void initModel(JSObject thiz) {
        thiz.setMember("content", "longstring");
      }

      I am going to attach two versions of the application. One that does the operations in JavaScript (and seems to run without leaks in 8u112) and one that performs the same operation from Java instead (and increases the process size significantly with each "tick").

      In addition to that I provide sources for the OK version and a patch to turn them into the Bad one. Should you have any issues reproducing the problem, please contact me.

        1. WebViewFX-Maven.zip
          114 kB
        2. WebViewFX-App-OK.zip
          302 kB
        3. WebViewFX-App-NoKnockout.zip
          280 kB
        4. WebViewFX-App-Bad.zip
          302 kB
        5. WebViewFX-App.diff
          3 kB
        6. WebKit-NoKnockout-src.zip
          17 kB
        7. WebEngineNotReleasingMemory.java
          4 kB
        8. TestToVerifyBehaviorOfGCs.diff
          7 kB
        9. snapshot-1477567245735.nps
          38 kB
        10. SimpleTestOfGCBehavior.diff
          5 kB
        11. Memory Consumption.png
          Memory Consumption.png
          191 kB
        12. MainApp.java
          4 kB
        13. JavaFXWebViewSketchOfAFix.diff
          5 kB
        14. dukeScript-heapdump.png
          dukeScript-heapdump.png
          158 kB

            mbilla Murali Billa
            jtulach Jaroslav Tulach (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: