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

Text selection in WebView cause massive prism memory usage

XMLWordPrintable

    • web
    • x86
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.8.0_152-ea"
      Java(TM) SE Runtime Environment (build 1.8.0_152-ea-b03)
      Java HotSpot(TM) Client VM (build 25.152-b03, mixed mode)

      also applies to 1.8.0_131, 1.8.0_121, 1.8.0_111 etc

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 SP1 64bit

      A DESCRIPTION OF THE PROBLEM :
      On some complex web pages, selecting any text on the page causes an immediate massive prism memory usage. (As shown by -Dprism.poolstats=true). Generally this will cause an exception when prism runs out of memory, unless you set prism.maxvram to something huge (e.g. 2G)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Write a trivial JavaFX app which opens a webview to the URL below. Run the app with -Dprism.poolstats=true and -Dprism.maxvram=2G

      http://download.vistair.com/javafx/textselectionmemoryissue/BMR-ALL-RPM/Latest/59/yuyv9b.html

      After rendering, my system reports approx 11MB VRAM usage.

      Click on some text at the top of the page and drag down the page to select some text. The VRAM usage shoots up to 600-800MB and eventually hits 2GB

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -

      Selecting text on a web page should not cause a huge spike in VRAM memory usage.
      ACTUAL -
      Immedialy after rendering page:

      D3D Vram Pool: 11,534,336 used (0.5%), 268,435,456 target (12.5%), 2,147,483,648 max
      5 total resources being managed
      average resource age is 1.6 frames
      0 resources at maximum supported age (0.0%)
      2 resources marked permanent (40.0%)
      0 resources have had mismatched locks (0.0%)
      0 resources locked (0.0%)
      3 resources contain interesting data (60.0%)
      0 resources disappeared (0.0%)

      After selecting some text on the page:

      D3D Vram Pool: 668,721,152 used (31.1%), 677,314,560 target (31.5%), 2,147,483,648 max
      6737 total resources being managed
      average resource age is 1.1 frames
      0 resources at maximum supported age (0.0%)
      2 resources marked permanent (0.0%)
      0 resources have had mismatched locks (0.0%)
      0 resources locked (0.0%)
      3 resources contain interesting data (0.0%)
      0 resources disappeared (0.0%)

      and eventually:

      D3D Vram Pool: 2,079,604,736 used (96.8%), 2,109,196,817 target (98.2%), 2,147,483,648 max
      9542 total resources being managed
      average resource age is 10.5 frames
      0 resources at maximum supported age (0.0%)
      2 resources marked permanent (0.0%)
      0 resources have had mismatched locks (0.0%)
      0 resources locked (0.0%)
      3 resources contain interesting data (0.0%)
      0 resources disappeared (0.0%)





      REPRODUCIBILITY :
      This bug can be reproduced always.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: