Code Cache, Compilation & Inlining
Nicolas Michael
mail at nmichael.de
Fri Jan 16 09:44:36 PST 2009
Hi Christian,
thanks a lot for this info! On our system, I get the following output
with a Java 7 debug build:
java -Xprintflags | grep CodeCacheSize
uintx InitialCodeCacheSize = 1572864 {pd
product}
uintx ReservedCodeCacheSize = 33554432 {pd
product}
This seems to roughly match our perfdata dumps that I automatically
collect with each testrun. With the default code cache size, I have the
following values after C2 stopped compiling because of a full code
cache:
sun.ci.nmethodCodeSize = 10727808
sun.ci.nmethodSize = 30215640
sun.ci.osrBytes = 26182
sun.ci.osrCompiles = 32
sun.ci.osrTime = 5016824306
sun.ci.standardBytes = 2292726
sun.ci.standardCompiles = 7550
sun.ci.standardTime = 578065415777
sun.ci.threads = 2
sun.ci.totalBailouts = 3
sun.ci.totalCompiles = 7582
sun.ci.totalInvalidates = 0
Which of these values fill up the 32 MB code cache?
sun.ci.nmethodSize + sun.ci.osrBytes + sun.ci.standardBytes = 32534548
??
What is "sun.ci.nmethodCodeSize", though? That's 10 MB -- if this came
on top, it would exceed the size of the code cache.
For a testrun with -XX:ReservedCodeCacheSize=128m I got the following
values which indicate that the default 32 MB was just slightly too small
and something like 48 MB would certainly be more than enough:
sun.ci.nmethodCodeSize = 12793696
sun.ci.nmethodSize = 36462344
sun.ci.osrBytes = 26469
sun.ci.osrCompiles = 39
sun.ci.osrTime = 7769266817
sun.ci.standardBytes = 2740711
sun.ci.standardCompiles = 8997
sun.ci.standardTime = 754631615591
sun.ci.threads = 2
sun.ci.totalBailouts = 2
sun.ci.totalCompiles = 9036
sun.ci.totalInvalidates = 0
So thanks again for your help!!
Anyone who could probably help me with the other issues about
deoptimization, interpreted code and inlining?
Thanks,
Nick.
Christian Thalinger schrieb:
> On Tue, 2009-01-13 at 11:45 +0000, Nicolas Michael wrote:
>> My questions are:
>> - How large is the code cache per default?
>
> The reserved code cache size depends on the architecture and the
> compiler used. With a debug build you can use the -Xprintflags switch
> to get the default size:
>
> $ java -Xprintflags | grep CodeCacheSize
> uintx InitialCodeCacheSize = 2555904 {pd product}
> uintx ReservedCodeCacheSize = 50331648 {pd product}
>
> In this case (C2 on amd64) it's 48MB.
>
>> - Is there any limit for the code cache? In my tests where I increased
>> it, I set it to 128m (which is much too large, I assume, but worked).
>
> AFAICT no, there is not. You can set it as high as your architecture
> can address memory.
>
> -- Christian
>
>
More information about the hotspot-compiler-dev
mailing list