problem with ClassLayout.parseClass

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Nov 5 20:41:54 UTC 2014


On 05.11.2014 23:27, Aleksey Shipilev wrote:
> Hi Nezih,
> 
> On 05.11.2014 22:33, Nezih Yigitbasi wrote:
>> We are seeing a weird GC problem with the jol library with the 
>> ClassLayout.parseClass() call. The problem is that the calling
>> thread spends a lot of time doing full GCs and it’s kind of stuck in
>> a GC loop. We only observed this problem with the
>> -XX:+UseConcMarkSweepGC and -XX:+ExplicitGCInvokesConcurrent flags
>> where the explicit System.gc() call in the VMSupport.guessAlignment()
>> method cause full GCs that are very slow (when these flags are
>> removed I see less number of full GCs that are much faster and I
>> don’t see the problem anymore). This seemed like a bug to me, but I
>> just wanted to check with you to understand it better.
> 
> Well, that code is running once during the initialization, and it does
> indeed calls for GC to condense the newly allocated array with objects
> to better estimate the alignment.
> 
> I would agree that unexpected System.gc coming from a library is a
> library bug, and therefore we can revisit this, filed:
>   https://bugs.openjdk.java.net/browse/CODETOOLS-7901085

Should be fixed now with:
  http://hg.openjdk.java.net/code-tools/jol/rev/c58aecad901f

Can you confirm?

-Aleksey.



More information about the jol-dev mailing list