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

Tremendous memory usage by JTextArea

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 8
    • client-libs
    • None
    • 8
    • b68
    • x86_64
    • linux_ubuntu

        This is a regression in JDK 8.
        In the attached test case, the program consumes almost 40 times more memory on JDK 8 than on JDK 7.
        Run the application on JDK 7 and JDK 8 respectively and compare the rough memory consumption, which is printed out. It can be verified by VisualVM.

        On JDK 7 I get output like:
        Memory before creating the text: 2979272
        Memory after creating the text: 1759008
        Memory after setting the text: 15285616
        Final memory after everything: 18265160

        On JDK 8 I get output like:
        Memory before creating the text: 2785728
        Memory after creating the text: 2194120
        Memory after setting the text: 616302904
        Final memory after everything: 696162136

        The first big chunk of memory is allocated at java.awt.font.TextLine.getComponents().

        I have a suspicion that the regression is caused by http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/aca4a67e560d although I did not verify it.

        JDK 7 used is:
        java version "1.7.0_76"
        Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
        Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)

        JDK 8 used is:
        java version "1.8.0_31"
        Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
        Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

              serb Sergey Bylokhov
              mentlich Martin Entlicher
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: