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

Reduce nmethod header size

    XMLWordPrintable

Details

    • b20
    • generic
    • generic

    Description

      Depending on application nmethod's header may take up to 10% (or more) of total size.
      Here the data I got on linux-86 running javac which compiles 10000 HelloWorld classes (we use this test in Leyden development):

      $ /jdk/build/optimized/images/jdk/bin/java -XX:+PrintNMethodStatistics -XX:+PrintCodeCache -cp ./JavacBenchIter.jar JavacBenchIter 10000
      args[0]: 10000
      Statistics for 146 native nmethods:
       N. total size = 75536
       N. relocation = 2600
       N. main code = 24935
      Statistics for 2822 bytecoded nmethods for C1:
       total in heap = 9463504 (100%)
       header = 857888 (9.065226%)
       relocation = 561344 (5.931672%)
       constants = 352 (0.003720%)
       main code = 5720240 (60.445263%)
       stub code = 300488 (3.175230%)
       oops = 22168 (0.234247%)
       metadata = 132856 (1.403877%)
       scopes data = 736232 (7.779698%)
       scopes pcs = 858976 (9.076722%)
       dependencies = 51928 (0.548719%)
       handler table = 69192 (0.731146%)
       nul chk table = 117248 (1.238949%)
       size > 32k = 29
       max size = 199920
      Statistics for 1282 bytecoded nmethods for C2:
       total in heap = 5560352 (100%)
       header = 389728 (7.009053%)
       relocation = 432288 (7.774472%)
       constants = 800 (0.014388%)
       main code = 2961984 (53.269722%)
       stub code = 57240 (1.029431%)
       oops = 24920 (0.448173%)
       metadata = 165392 (2.974488%)
       scopes data = 843816 (15.175586%)
       scopes pcs = 437904 (7.875473%)
       dependencies = 54872 (0.986844%)
       handler table = 113424 (2.039871%)
       nul chk table = 62336 (1.121080%)
       size > 32k = 25
       max size = 66744
      Debug Data Chunks: 408613, shared 234476+0, non-SP's elided 0
      PcDesc Statistics: 8169 queries, 6.70 comparisons per query
        caches=4104 queries=8169/0, hits=0+1299, tests=26366+28386, adds=6870
      Dependency check (find_witness) calls=23229, steps=158704 (avg=6.8), singles=506
      CodeHeap 'non-profiled nmethods': size=118592Kb used=5796Kb max_used=5796Kb free=112795Kb
       bounds [0x00007ff430524000, 0x00007ff430ad4000, 0x00007ff4378f4000]
      CodeHeap 'profiled nmethods': size=118588Kb used=9320Kb max_used=9320Kb free=109267Kb
       bounds [0x00007ff4288f4000, 0x00007ff429214000, 0x00007ff42fcc3000]
      CodeHeap 'non-nmethods': size=8580Kb used=1397Kb max_used=4322Kb free=7182Kb
       bounds [0x00007ff42fcc3000, 0x00007ff430103000, 0x00007ff430524000]
      CodeCache: size=245760Kb, used=16513Kb, max_used=19438Kb, free=229244Kb
       total_blobs=4731, nmethods=4250, adapters=388, full_count=0
      Compilation: enabled, stopped_count=0, restarted_count=0

      Attachments

        Issue Links

          Activity

            People

              kvn Vladimir Kozlov
              kvn Vladimir Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: