JDK-8005885 : enhance PrintCodeCache to print more data
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs25,9,10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-01-08
  • Updated: 2023-08-23
  • Resolved: 2022-02-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 19
19 b12Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Currently we only print:

CodeCache:
nmethod dependency checking time 0.037552
 #944 live = 3681K (hdr 4%,  loc 2%, code 74%, stub 1%, [oops 0%, data 0%, pcs 5%])
 #92 dead = 247K (hdr 7%,  loc 6%, code 46%, stub 3%, [oops 0%, data 0%, pcs 12%])

We should enhance the machinery to:

- print live and dead method information for all tiers
- print absolute numbers instead of percentages
- print size of template interpreter code
- print size of stub code (maybe number of stubs?)
- maybe print percentage of code cache memory used for tiers/interpreter/stubs
Comments
Changeset: b6843a16 Author: Yi-Fan Tsai <yftsai@amazon.com> Committer: Paul Hohensee <phh@openjdk.org> Date: 2022-02-24 19:42:16 +0000 URL: https://git.openjdk.java.net/jdk/commit/b6843a162411b0fa32271592d8f3a6f241a54384
24-02-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7389 Date: 2022-02-08 19:17:32 +0000
16-02-2022

Assigning to Xin Liu on behalf of Yi-Fan Tsai <yftsai@amazon.com>
26-01-2022

cthaling@sc14ia01:~/nashorn/v8$ java -d64 -server -XX:+TieredCompilation -Xmx3G -Xms3G -XX:+UnlockDiagnosticVMOptions -XX:+PrintCodeCache -jar ../nashorn/dist/nashorn.jar run-v8.js -- --verbose --iterations 10 crypto.js command line: running crypto.js... Score: 1024 Score: 1702 Score: 1915 Score: 1909 Score: 1786 Score: 1968 Score: 1832 Score: 1907 Score: 1852 Score: 1975 command line: Crypto (version 8): 1024-1975 CodeCache: Tier 0: total=199k, used=118k Tier 1: #289 live = 209K (hdr 39%, loc 5%, code 25%, stub 20%, [oops 0%, data 0%, pcs 1%]) Tier 2: #11 live = 22K (hdr 14%, loc 5%, code 27%, stub 10%, [oops 2%, data 2%, pcs 24%]) Tier 3: #3332 live = 14502K (hdr 6%, loc 4%, code 48%, stub 4%, [oops 1%, data 1%, pcs 24%]) #14 dead = 172K (hdr 2%, loc 4%, code 43%, stub 2%, [oops 1%, data 1%, pcs 37%]) Tier 4: #867 live = 5635K (hdr 4%, loc 3%, code 26%, stub 1%, [oops 1%, data 1%, pcs 50%]) Stubs: #56 runtime = 24K (hdr 15%, loc 2%, code 79%, stub 0%, [oops 0%, data 0%, pcs 0%]) #1 deoptimization = 1K (hdr 7%, loc 0%, code 89%, stub 0%, [oops 0%, data 0%, pcs 0%]) #1 uncommon trap = 0K (hdr 12%, loc 1%, code 83%, stub 0%, [oops 0%, data 0%, pcs 0%]) #1 exception = 0K (hdr 26%, loc 3%, code 66%, stub 0%, [oops 0%, data 0%, pcs 0%]) #3 safepoint = 1K (hdr 10%, loc 1%, code 87%, stub 0%, [oops 0%, data 0%, pcs 0%]) #322 C2I/I2C adapter = 150K (hdr 13%, loc 1%, code 83%, stub 0%, [oops 0%, data 0%, pcs 0%]) #1 method handles adapter = 31K (hdr 0%, loc 0%, code 99%, stub 0%, [oops 0%, data 0%, pcs 0%]) #26 other = 3128K (hdr 0%, loc 0%, code 99%, stub 0%, [oops 0%, data 0%, pcs 0%]) These are the names and sizes of the "other" stubs (note: the interpreter is also listed here): name=flush_icache_stub, size=144 name=getPsrInfo_stub, size=632 name=StubRoutines (1), size=19080 name=Interpreter, size=204880 name=InlineCacheBuffer, size=10320 name=adapters, size=16464 name=StubRoutines (2), size=22080 name=jni_fast_GetBooleanField, size=320 name=native signature handlers, size=32848 name=Signature Handler Temp Buffer, size=1104 name=jni_fast_GetByteField, size=320 name=jni_fast_GetCharField, size=320 name=jni_fast_GetShortField, size=320 name=jni_fast_GetIntField, size=320 name=jni_fast_GetLongField, size=320 name=jni_fast_GetFloatField, size=320 name=jni_fast_GetDoubleField, size=320 name=Compiler1 temporary CodeBuffer, size=576800 name=Compiler1 temporary CodeBuffer, size=576800 name=Compiler1 temporary CodeBuffer, size=576800 name=Compiler1 temporary CodeBuffer, size=576800 name=Compiler1 temporary CodeBuffer, size=576800 name=vtable chunks, size=1880 name=vtable chunks, size=4184 name=vtable chunks, size=1880 name=vtable chunks, size=1880
08-01-2013

Some quick data for V8's crypto: cthaling@sc14ia01:~/nashorn/v8$ java -d64 -server -XX:-TieredCompilation -Xmx3G -Xms3G -XX:+UnlockDiagnosticVMOptions -XX:+PrintCodeCache -jar ../nashorn/dist/nashorn.jar run-v8.js -- --verbose --iterations 10 crypto.js command line: running crypto.js... Score: 627 Score: 1579 Score: 1834 Score: 1704 Score: 1820 Score: 1715 Score: 1855 Score: 1775 Score: 1772 Score: 1835 command line: Crypto (version 8): 627-1855 CodeCache: Tier 1: Tier 2: Tier 3: Tier 4: #1352 live = 3559K (hdr 10%, loc 3%, code 28%, stub 2%, [oops 1%, data 2%, pcs 35%]) cthaling@sc14ia01:~/nashorn/v8$ java -d64 -server -XX:+TieredCompilation -Xmx3G -Xms3G -XX:+UnlockDiagnosticVMOptions -XX:+PrintCodeCache -jar ../nashorn/dist/nashorn.jar run-v8.js -- --verbose --iterations 10 crypto.js command line: running crypto.js... Score: 1120 Score: 1847 Score: 1845 Score: 1942 Score: 1873 Score: 1908 Score: 1894 Score: 1957 Score: 1908 Score: 1898 command line: Crypto (version 8): 1120-1957 CodeCache: Tier 1: #290 live = 210K (hdr 39%, loc 5%, code 25%, stub 20%, [oops 0%, data 0%, pcs 1%]) Tier 2: #7 live = 10K (hdr 19%, loc 6%, code 29%, stub 14%, [oops 2%, data 1%, pcs 15%]) Tier 3: #3319 live = 14600K (hdr 6%, loc 4%, code 48%, stub 4%, [oops 1%, data 1%, pcs 24%]) #9 dead = 116K (hdr 2%, loc 4%, code 42%, stub 2%, [oops 1%, data 1%, pcs 38%]) Tier 4: #868 live = 5229K (hdr 4%, loc 3%, code 26%, stub 1%, [oops 1%, data 1%, pcs 48%])
08-01-2013