Hi all,<div><br></div><div>Comments on bug 7066603, inline below:<br><br><div class="gmail_quote">On Wed, Nov 16, 2011 at 4:05 AM, Tom Rodriguez <span dir="ltr"><<a href="mailto:tom.rodriguez@oracle.com" target="_blank">tom.rodriguez@oracle.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
<div><br>On Nov 14, 2011, at 2:00 PM, Martin Hare Robertson wrote:<br></div><div>> The biggest unresolved problem was reported under bug 7066603. Sadly this seems to have been marked as low priority.<br>
<br></div>It seems to have gotten stuck over in the wrong category.  I've moved into the proper category and updated it.  It appears CMS isn't visiting some regular Java objects held in perm so they are missing from the dump.  The recent changes to move Strings and Classes out of perm make this problem disappear in JDK7.  So it only affects JDK6 at this point.  I believe the bug is in the obj_is_alive logic that CMS uses to visit only live objects in perm.<br>

</blockquote><div><br></div><div>Looking at the repro example in bug 7066603, I agree that the problem seem to lie in obj_is_alive logic.</div><div><br></div><div>A quick patch to HotSpot 20.0 [1]:</div><div><br></div><div>
<div><font class="Apple-style-span" face="'courier new', monospace">diff -r f0f676c5a2c6 src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp</font></div><div><font class="Apple-style-span" face="'courier new', monospace">--- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp   Tue Mar 15 19:30:16 2011 -0700</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">+++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp   Wed Nov 16 20:38:29 2011 +0800</font></div><div><font class="Apple-style-span" face="'courier new', monospace">@@ -1143,7 +1143,7 @@</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">         return (dead_map->sizeInBits() == 0) // bit_map has been allocated</font></div><div><font class="Apple-style-span" face="'courier new', monospace">                || !dead_map->par_isMarked((HeapWord*) p);</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">       } else {</font></div><div><font class="Apple-style-span" face="'courier new', monospace">-        return false; // We can't say for sure if it's live, so we say that it's dead.</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">+        return true; // We can't say for sure if it's live, so we say that it's alive.</font></div><div><font class="Apple-style-span" face="'courier new', monospace">       }</font></div>
<div><font class="Apple-style-span" face="'courier new', monospace">     }</font></div><div><font class="Apple-style-span" face="'courier new', monospace">   }</font></div></div><div><br></div><div>With this patch, re-run the repro, and jhat doesn't complain any more.</div>
<div><br></div><div>I'm not sure yet if this is the right change. It's interesting to find that in the repro example, all objects missing from the heap dump seem to be Strings referenced by objects in PermGen; the roots are most probably static fields.</div>
<div><br></div><div>Regards,</div><div>Kris Mok</div><div><br></div><div>[1]: <a href="http://hg.openjdk.java.net/hsx/hsx20/master/file/f0f676c5a2c6/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp">http://hg.openjdk.java.net/hsx/hsx20/master/file/f0f676c5a2c6/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp</a></div>
<div> </div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
tom</blockquote></div></div>