RFR(XS): 8214235: assertion in collectedHeap.cpp: attempt to clean empty remainder

Thomas Schatzl thomas.schatzl at oracle.com
Fri Nov 30 09:26:07 UTC 2018


Hi,

On Thu, 2018-11-29 at 18:13 +0300, Boris Ulasevich wrote:
> Hi Per,
> 
> On 29.11.2018 16:30, Per Liden wrote:
> > Hi,
> > 
> > On 11/29/18 12:02 PM, Boris Ulasevich wrote:
> > > Hi Per,
> > > 
> > > On 28.11.2018 17:35, Per Liden wrote:
> > > > Hi,
> > > > 
> > > > On 11/28/18 1:39 PM, Boris Ulasevich wrote:
> > > > > Hi all,
> > > > > 
> > > > > Please review a simple fix: do not fill remaining tlab memory
> > > > > when the remainder is empty.
> > > > 
> > > > Hmm I get the feeling something else is wrong here. Like a
> > > > misaligned 
> > > > object or a misaligned object size was allocated in the TLAB.
> > > 
> > > Actually assertion check catches the case when top() = end().
> > > I do not think it is something criminal. May be it is better to
> > > add check (top() < hard_end()) instead:
> > > http://cr.openjdk.java.net/~bulasevich/8214235/webrev.00

Using hard_end() is correct here, however I would explicitly use zero
as a comparison here as we still want to error out in
fill_with_dummy_object() if the remainder is > 0 && < min_fill_size().

In any case, with a delta of zero we trivially do not need a filler
object.

But others might disagree.

> > 
> > There's still something fishy here. The TLAB alignment_reserve
> > should make sure there's always enough space left for a filler
> > object. 
> 
> My case is different! alignment_reserve() returns 0:
> alignment_reserve() = MAX2(tlab_alloc_reserve(), 
> _reserve_for_allocation_prefetch) =
> MAX2(min_dummy_object_size() > MinObjAlignment ?
> min_dummy_object_size() 
> : 0, is_server_compilation_mode_vm() ? a+b*c/d : 0) =
> MAX2(2 > 2 ? 2 : 0, 0 ? a+b*c/d : 0) = MAX2(0, 0) = 0

On 32 bit the filler object may be exactly the same size as
MinObjAlignment so this is a valid case.

Thanks,
  Thomas




More information about the hotspot-gc-dev mailing list