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

CDS Lambda Proxy classes are regenerated in dynamic dump

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • 21
    • hotspot
    • b15

      If a Lambda Proxy class has been stored in the CDS static archive, we still generate it again for the dynamic archive. This wastes space in the dynamic archive.

      ==========
      $ java -Xshare:off -XX:DumpLoadedClassList=javac.classlist com.sun.tools.javac.Main HelloWorld.java

      $ grep @lambda-proxy javac.classlist | wc -l
      169

      $ java -Xshare:dump -XX:SharedClassListFile=javac.classlist -XX:SharedArchiveFile=javac-static.jsa -Xlog:cds=debug
      [...]
      [1.702s][info ][cds] Number of classes 2512
      [1.702s][info ][cds] instance classes = 2402
      [1.702s][info ][cds] boot = 1199
      [1.702s][info ][cds] app = 1133
      [1.702s][info ][cds] platform = 70
      [1.702s][info ][cds] unregistered = 0
      [1.702s][info ][cds] (hidden) = 172 << lambda proxy classes
      [1.702s][info ][cds] (unlinked) = 0
      [1.702s][info ][cds] obj array classes = 101
      [1.702s][info ][cds] type array classes = 9
      [1.702s][info ][cds] symbols = 57098

      $ java -XX:SharedArchiveFile=javac-static.jsa -XX:ArchiveClassesAtExit=javac-dynamic.jsa -Xlog:cds=debug com.sun.tools.javac.Main HelloWorld.java
      [...]
      [0.967s][info ][cds] Number of classes 172
      [0.967s][info ][cds] instance classes = 172
      [0.967s][info ][cds] boot = 42
      [0.967s][info ][cds] app = 130
      [0.967s][info ][cds] platform = 0
      [0.967s][info ][cds] unregistered = 0
      [0.967s][info ][cds] (hidden) = 168 << same lambda proxy classes are generated again
      [0.967s][info ][cds] (unlinked) = 0
      [0.967s][info ][cds] obj array classes = 0
      [0.967s][info ][cds] type array classes = 0
      [0.967s][info ][cds] symbols = 168

            ccheung Calvin Cheung
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: