RFR (M): 8129558: Coalesce dead objects during removal of self-forwarded pointers

Tony Printezis tprintezis at twitter.com
Thu Jun 25 21:42:04 UTC 2015


Thomas,

On June 25, 2015 at 4:36:08 PM, Thomas Schatzl (thomas.schatzl at oracle.com) wrote:

Hi, 

On Thu, 2015-06-25 at 13:06 -0700, Tony Printezis wrote: 
> Thomas, 
> 
> Inline, towards the end. 
> 
>[...] 
> > You are right about this. However considering these are going to be 
> > dead 
> > objects, they will never be iterated over using the BOT in 
> > performance 
> > sensitive code. 
> 
> I agree. But isn’t there an edge case? Imagine you have the sequence 
> of D* dead objects, followed by A (a live object): 
> 
> D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 A 
> 
> Let’s say your code replaces the D* dead objects with two filler 
> objects, F0 and F1: 
> 
> F0 F1 A 
> 
> If A’s start is in the middle of a card, in order to scan that card, 
> won’t the BOT do more work to find the first object on that card given 
> that it will have to look-up F0 which is further away? Also, note that 
> the BOT look-up for A will actually NOT return the first object on 
> that card (F0). Will that break any asserts? 

actually there are cases when the code may try to scan random cards 
within these regions anyway: remembered sets may contain stale entries 
forever to these areas, so these objects may be scanned through 
(needlessly). 


Yes.




However this will likely be fast, as the code will likely create a 
log-based slide on the BOT 


Yes, that iteration over the BOT to find F0 from A’s card was what I was a bit concerned about. F0 will always be larger than F1, so if you can actually try to look-up F1, instead of F0, you’ll always be better off. :-)



for combined F0/F1. Catching up to A from F0 
will be fast because there are just two objects in there now to iterate, 


The iteration over F0 / F1 was less of a concern (even though you’ll probably hit an extra cache miss or two).




and after that first lookup of the start of A, the BOT will have been 
fixed up. 

I will fix it anyway for hygiene reasons, 


Cool.



it will not be the nicest code 
but do the job. Still a lot faster than trying to fix up the BOT for 
every tiny object as done previously. :) 


Agreed, this is a good change.



Tony




Thanks, 
Thomas 







-----

Tony Printezis | JVM/GC Engineer / VM Team | Twitter

@TonyPrintezis
tprintezis at twitter.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/attachments/20150625/df2ca997/attachment.html>


More information about the hotspot-gc-dev mailing list