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

[CSS] Memory leak in stylesheet handling

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 7u45
    • Fix Version/s: 7u60
    • Component/s: javafx
    • Environment:

      win7, java 1.7.0_45, javafx 2.2.45-b18

      Description

      I have a real world application that shows a flow of images decorated with some labels. New images are loaded every minute or so and the application should be able to run for several days or weeks.

      After customers reported that the application crashes with an OutOfMemoryError I have done some profiling and discovered that the application has a memory leak in the javafx StyleManager class. It seems to be related to the way that stylesheets are applied to GUI components in the application. If a stylesheet is applied in a component that is created over and over again then more and more memory is used in the StyleManager and even though the component itself is removed from the scene memory is never released from the StyleManager.

      I have created a simple test-application that gets an OutOfMemoryError after a few minutes when run with -Xmx32m.

      I will try to attach the code.

      Output from my test-application:

      javafx.runtime.version: 2.2.45-b18
      java.lang.OutOfMemoryError: GC overhead limit exceeded
      at com.sun.javafx.css.StyleHelper.calculateValue(StyleHelper.java:1459)
      at com.sun.javafx.css.StyleHelper.lookupFont(StyleHelper.java:1999)
      at com.sun.javafx.css.StyleHelper.lookup(StyleHelper.java:1017)
      at com.sun.javafx.css.StyleHelper.transitionToState(StyleHelper.java:863)
      at javafx.scene.Node.impl_processCSS(Node.java:7419)

        Attachments

          Activity

            People

            • Assignee:
              dgrieve David Grieve (Inactive)
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: