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

Memory leak in JavaFX WebView

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8u102, 9
    • Fix Version/s: 9
    • Component/s: javafx
    • Labels:
    • Subcomponent:
      web
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Fix failed

      Description

      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.

        Attachments

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

          Issue Links

            Activity

              People

              • Assignee:
                mbilla Murali Billa
                Reporter:
                jtulach Jaroslav Tulach
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: