JIT stops compiling after a while (java 7)

Martin Traverso 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:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent
-XX:+CMSClassUnloadingEnabled. This also works around the problem.
3. I disabled the call to System.gc() and ran it with
-XX:+UseConcMarkSweepGC -XX:+ExplicitGCInvokesConcurrent
-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.

Regards,
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20130814/b87e55cb/attachment.html 


More information about the hotspot-gc-dev mailing list