<div dir="ltr">Mikael,<div><br></div><div>I updated the patch as you mentioned.</div><div>There are no "set"_root_scanning_option, so I added that.</div><div><a href="http://cr.openjdk.java.net/~rasbold/8024954/webrev/">http://cr.openjdk.java.net/~rasbold/8024954/webrev/</a><br>
</div><div><br></div><div>Jungwoo</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 19, 2013 at 4:48 AM, Mikael Gerdin <span dir="ltr"><<a href="mailto:mikael.gerdin@oracle.com" target="_blank">mikael.gerdin@oracle.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jungwoo,<div><div class="h5"><br>
<br>
On 2013-09-17 01:14, Jungwoo Ha wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
We found that hotspot crashes when CMSClassUnloadingEnabled is true, and<br>
CMSClassUnloadingMaxInterval > 0.<br>
This is on hotspot24 and u40.<br>
This is easily reproducible with DaCapo tradesoap benchmark with<br>
heapsize around 200MB.<br>
<br>
The reason for the crash is that CMS sets the root set when<br>
CMSClassUnloadingEnabled is on during the constructor phase assuming<br>
that every CMS cycle will unload the class.<br>
However, when CMSClassUnloadingMaxInterval > 0, CMS may not unload<br>
classes ended up crashing.<br>
I think this is apparently a bug, and I attach the fix.<br>
Please take a look at the attached patch.<br>
My changes are resetting the root scanning option on every CMS cycle in<br>
setup_cms_unloading_and_<u></u>verification_state() if CMSCLassUnloadingEnabled<br>
is on.<br>
<br>
Please take a look and let us know how to proceed.<br>
</blockquote>
<br></div></div>
Jon filed a bug for this:<br>
<a href="https://bugs.openjdk.java.net/browse/JDK-8024954" target="_blank">https://bugs.openjdk.java.net/<u></u>browse/JDK-8024954</a><br>
<br>
I think the code change fixes the bug but I'd like it better if you changed the code to always set the requested ScanOption values in setup_cms_unloading_and_<u></u>verification_state<br>
<br>
something like:<br>
if (should_unload_classes()) {<br>
set_root_scanning_option(SO_<u></u>SystemClasses);<br>
} else {<br>
set_root_scanning_option(SO_<u></u>AllClasses|SO_Strings|SO_<u></u>CodeCache);<br>
}<br>
<br>
I also believe that your check for CMSClassUnloadingEnabled can cause a bug similar to the one you are trying to fix if ExplicitGCInvokesConcurrentAnd<u></u>UnloadsClasses would be enabled.<br>
should_unload_classes() should be sufficient to determine which ScanOptions to set for a particular cms cycle.<br>
<br>
Please send a patch/webrev based on the latest jdk8 sources <a href="http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot" target="_blank">http://hg.openjdk.java.net/<u></u>hsx/hotspot-gc/hotspot</a><br>
Since the function is also messing around with the verification flags, make sure to run some tests on your changes with verification enabled.<br>
<br>
/Mikael<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
Jungwoo<br>
</blockquote>
</blockquote></div><br></div>