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

[WebView] JVM crash due to memory leak in WebView/Webkit

    Details

    • Subcomponent:
      web

      Description

      Note, this description was already given by my colleague Nicolai Kilian to RT-30354, which seems to describe the same issue but was put to resolved even though the issue can still be reproduced both on Java 1.7.0_45 as well as Java 8 build 120 (see Dierk König's comment on RT-30354). As commenting didn't help we create a new issue.

      For us this issue is not just critical but actually a blocker (!) as the WebView is needed for the core functionality of our customer project!



      We're experiencing crashes in JavaFX web browser when using Google Maps.
      It can be reproduced using this little project:

      http://uploadir.com/uploads/9uitfqvw/downloads/new

      From the README:

      Application to test memory consumption behavior of Google Maps inside the embedded webkit browser of JavaFX.
      It demonstrates that under Java 1.7.0_45, there is a memory leak related to JavaFX when using Google Maps with a lot of objects,
      in contrast to loading the same HTML in Google Chrome.

      ** Test scenario **
      When mapViewer.html is loaded, the Browser first navigates to Google Maps.
      Then, in Javascript, 10'000 markers in and around Switzerland are created and displayed in Google Maps.
      Finally, zooming in and out in the area of Switzerland is performed 40 times.

      ** Test environments **
      All tests were performed under Windows 7 so far.
      If mapViewer.html is opened in Google Chrome version 31.0.1650.63 m, the process memory consumption remains well below 300 MB.
      However, if it is opened in the JavaFX application, Java 1.7.0_45, the process memory consumption increases from 200 MB to about 1500 MB.
      At this point, the application crashes under Java 32 bit, but the memory leak is equally visible under Java 64 bit.

      ** How to reproduce **
      - Install Java 1.7.0_45, JRE 32bit. http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
      - Install Maven 3. http://maven.apache.org/download.cgi
      - Edit googlemapsloader.js, edit the variable "var gMapsKey=". Insert your Google Maps API key into the quotes. How to get a key:
        https://developers.google.com/maps/documentation/javascript/tutorial?hl=fr#api_key
      - Open mapViewer.html in Google Chrome and watch the working memory consumption, e.g. using Process Explorer under Windows.
      - In the command line, navigate to the projects main directory and enter
        mvn clean jfx:jar <Return>
      - Then, in Windows explorer, navigate to JFXMemoryTest\target\jfx\app and double-click JFXMemoryTests-1.0-SNAPSHOT-jfx.jar.
        Watch the growing working memory consumption, e.g. using Process Explorer under Windows.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                anashaty Anton Nashatyrev (Inactive)
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                10 Vote for this issue
                Watchers:
                18 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: