<div dir="ltr">Yes, that was the idea of splitting the two apart, and of allowing the CMS perm gen to be collected when deemed necessary. The policy of when to collect was never adequately implemented though and just rode on the flag to either always or never do it...<div><br></div><div>It would be good to get this cleaned up and implemented, given the cost on the remark phases as we seem to be (re)discovering each time we enable it on by default ... old CMS hands will remember the tortured history of this :-)</div><div><br></div><div>-- ramki</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 11, 2016 at 10:32 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"><span class=""><br>
<br>
On 2016-03-11 18:29, Jon Masamitsu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On 3/11/2016 8:12 AM, Tony Printezis wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for the heads up Jungwoo. I think it should be straightforward<br>
to decide whether to unload classes for a particular CMS cycle based<br>
on the rate at which the meatspace occupancy is growing. Has anyone<br>
considered / looked into this?<br>
</blockquote>
<br>
No one has looked at this to my knowledge.<br>
</blockquote>
<br></span>
Another, perhaps simpler, alternative would be to enable class unloading for a single CMS cycle at<br>
  if (MetaspaceGC::should_concurrent_collect()) {<br>
    log_trace(gc)("CMSCollector: collect for metadata allocation ");<br>
    return true;<br>
  }<br>
<br>
This would cause metaspace allocation triggered CMS cycles to unload classes at least.<br>
<br>
/Mikael<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Jon<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
Tony<br>
<br>
On March 10, 2016 at 7:07:00 PM, Jungwoo Ha (<a href="mailto:jwha@google.com" target="_blank">jwha@google.com</a><br></span>
<mailto:<a href="mailto:jwha@google.com" target="_blank">jwha@google.com</a>>) wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
We've been disabled CMSClassUnloading for a long time and had no issues.<br>
We recently turned it back on by default with<br>
CMSClassUnloadingMaxInterval=5, which amortizes the increased remark<br>
cost.<br>
<br>
<br>
On Thu, Mar 10, 2016 at 1:32 PM, Tony Printezis<br></span><span class="">
<<mailto:<a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a>><a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a>> wrote:<br>
<br>
    Hi all,<br>
<br>
    CMSClassUnloadingEnabled is enabled by default in JDK 8. Most of<br>
    our services do not require class unloading (they load a bunch of<br>
    classes up-front and that’s it) so we’re thinking of turning it<br>
    off by default in our JDK as it increases our remark times by a<br>
    non-trivial amount (40-90ms depending on the service). Any known<br>
    issues with running with -XX:-CMSClassUnloadingEnabled? (This is<br>
    a veiled way to ask: is anyone testing with that flag off?)<br>
<br>
    Thanks,<br>
<br>
    Tony<br>
<br>
    -----<br>
<br>
    Tony Printezis | JVM/GC Engineer / VM Team | Twitter<br>
<br>
    @TonyPrintezis<br></span>
    <a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a> <mailto:<a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a>><span class=""><br>
<br>
<br>
<br>
<br>
--<br>
Jungwoo Ha | Java Platform Team | <a href="mailto:jwha@google.com" target="_blank">jwha@google.com</a><br></span>
<mailto:<a href="mailto:jwha@google.com" target="_blank">jwha@google.com</a>><br>
<br>
</blockquote><span class="">
-----<br>
<br>
Tony Printezis | JVM/GC Engineer / VM Team | Twitter<br>
<br>
@TonyPrintezis<br>
</span><a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a> <mailto:<a href="mailto:tprintezis@twitter.com" target="_blank">tprintezis@twitter.com</a>><br>
<br>
</blockquote>
<br>
</blockquote>
</blockquote></div><br></div>