RFR 8085965: VM hangs in C2Compiler
Jon Masamitsu
jon.masamitsu at oracle.com
Thu Jun 11 01:42:59 UTC 2015
Poonam,
http://cr.openjdk.java.net/~poonam/8085965/webrev/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp.frames.html
I think it reads more easily if it is coded like this
if (!ClassUnloading) {
_should_unload_classes = false;
} else if ((_full_gc_requested &&
ExplicitGCInvokesConcurrentAndUnloadsClasses) {
_should_unload_classes = true
} else if (CMSClassUnloadingEnabled) {
// Condition 2.a above 2678
// Disjuncts 2.b.(i,ii,iii) above
_should_unload_classes = (concurrent_cycles_since_last_unload() >=
CMSClassUnloadingMaxInterval)
|| _cmsGen->is_too_full();
}
I might not have cut-and-pasted it right but I think you can see what I
mean.
Also fix the block comment above to say that ClassUnloading overides the
other
conditions.
http://cr.openjdk.java.net/~poonam/8085965/webrev/src/share/vm/runtime/arguments.cpp.frames.html
This catches the case where -Xnoclassgc is used but does not catch if
-XX:-ClassUnloading is used. Yes?
2752 } else if (match_option(option, "-Xnoclassgc")) {
2753 FLAG_SET_CMDLINE(bool, ClassUnloading, false);
2754 FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
Instead if you add in "share/vm/runtime/arguments.cpp" to the method
1262 void Arguments::set_cms_and_parnew_gc_flags() ;
if (!ClassUnloading) {
FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
}
That should catch both -Xnoclassgc and -XX:-ClassUnloading
Jon
On 6/10/2015 2:20 PM, Poonam Bajaj Parhar wrote:
> Please review the code changes to fix:
> JDK-8085965: <https://bugs.openjdk.java.net/browse/JDK-8085965> VM
> hangs in C2Compiler
>
> Problem and fix:
> In JDK8, CMSClassUnloadingEnabled option which is used to control the
> class-unloading in CMS, was enabled by default. But if the user
> specifies -Xnoclassgc or -XX:-ClassUnloading on the command line then
> classes get unloaded but updating of subklasses/siblings links gets
> skipped by the ClassUnloading check in the following function:
>
> /void Klass::clean_weak_klass_links(BoolObjectClosure* is_alive, bool /
> /clean_alive_klasses) {/
> / if (!ClassUnloading) {/
> / return;/
> / }
>
> /which corrupts the class hierarchy links causing hangs and crashes.
>
> This fix honors -XX:-ClassUnloading and -Xnoclassgc options and
> disables class unloading with CMS.
>
> Webrev: http://cr.openjdk.java.net/~poonam/8085965/webrev/
>
> Thanks,
> Poonam
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20150610/7ba25749/attachment.htm>
More information about the hotspot-gc-dev
mailing list