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

Reorder the methods in the shared archive to improve locality

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • tbd
    • 9
    • hotspot

      The CDS shared archive contains many methods that are infrequently used, and many of them are never referenced by typical applications. The ratio of unreferenced methods could be very high (as much as 70%) when we create a custom CDS archive (using the -XX:SharedArchiveFile option) for a specific application.

      We can reduce memory footprint by splitting the methods between referenced and unreferenced so that we minimize the number of pages which are memory mapped in from the archive.

      The proposal is:

      + When creating a custom CDS archive, the customer would first do a "trial run" of the application. In the trial run, specify the -XX:+LogTouchedMethods flag (introduced by JDK-8025692) .
      + Use "jcmd VM.print_touched_methods" to connect to the application and save the list of referenced methods into a text file touched_methods.txt
      + Next, invoke java -Xshare:dump to dump the shared archive. The contents of touched_methods.txt will be used to reorder the shared archive to segregate the unreferenced methods into a separate section.

      The command-line option to pass touched_methods.txt to "java -Xshare:dump" is TBD.

            Unassigned Unassigned
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: