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. dukeScript-heapdump.png
          158 kB
          Abhijit Roy
        2. JavaFXWebViewSketchOfAFix.diff
          5 kB
          Jaroslav Tulach
        3. MainApp.java
          4 kB
          Jaroslav Tulach
        4. Memory Consumption.png
          191 kB
          Abhijit Roy
        5. SimpleTestOfGCBehavior.diff
          5 kB
          Jaroslav Tulach
        6. snapshot-1477567245735.nps
          38 kB
          Abhijit Roy
        7. TestToVerifyBehaviorOfGCs.diff
          7 kB
          Jaroslav Tulach
        8. WebEngineNotReleasingMemory.java
          4 kB
          Murali Billa
        9. WebViewFX-App.diff
          3 kB
          Jaroslav Tulach

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

              Created:
              Updated:
              Resolved: