JIT stops compiling after a while (java 7)
mtraverso at gmail.com
Wed Aug 14 12:29:46 PDT 2013
Thanks for your response, Vladimir.
VM stops compiling when it CodeCache is full, it is normal (no space left
> for compiled code). PermGen clean up means some classes were unloaded.
> During class unloading its methods are removed from CodeCache leaving some
> space for new compilations.
So, if I'm reading this correctly, methods aren't removed from the code
cache unless their class is gone, even if they haven't been called for a
long time (and never will).
Based on your insights, I ran a few more experiments:
1. I tried sizing the perm gen so that it GCs before the code cache fills
up. That seems to work around the problem, but it's very tricky to manage
and tune in a real system.
2. I modified the program to call System.gc() every second and ran it with
-XX:+CMSClassUnloadingEnabled. This also works around the problem.
3. I disabled the call to System.gc() and ran it with
-XX:+CMSClassUnloadingEnabled. And this is where it gets interesting:
a. As long as I keep triggering GC (manually, from VisualVM) before the
code cache fills up, everything works well.
b. If I let the code cache fill up, the VM gets into the bad condition
and does not recover no matter how many times I trigger GC afterwards to
unload classes from the perm gen.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-gc-dev