G1: SoftReference, 0 refs, 31.0027203 secs

Kim Barrett kim.barrett at oracle.com
Tue Jul 28 21:34:34 UTC 2015


On Jul 27, 2015, at 9:37 AM, Simone Bordet <simone.bordet at gmail.com> wrote:
> 
> On Tue, Jul 21, 2015 at 3:52 AM, Kim Barrett <kim.barrett at oracle.com> wrote:
>> On Jul 20, 2015, at 4:24 PM, charlie hunt <charlie.hunt at oracle.com> wrote:
>>> Perhaps someone on the GC team has some thoughts as a situation where we would see 0 SoftReferences processed yet a high amount of time spent there.
>> 
>> We’ve seen other reports of long soft reference processing times, despite having none to process.  See, for example, email to this list from Joy Xiong, circa 5/20/2015, subject “Long Reference Processing Time”.
>> 
>> I’ve spent some time looking at the reference processing code, but I don’t see anything in the reference processing code itself that would cause this.
>> 
>> However, there might be a possible mis-attribution of time here.  Soft references are the first references to be processed.  The phase1 reference processing first iterates over the (empty in this case) soft reference list.  It then calls the “complete_gc” closure to process any mark stack entries added by that iteration.  But if there were already mark stack entries when reference processing was started, the time for processing them would be included in the soft reference processing time.
>> 
>> I *think* the mark stack (including the thread queues) ought to be empty when reference processing is started, but I’m not certain of that.  If it isn’t empty but is supposed to be, that would be a bug.  If it isn’t empty and that’s permitted, then the resulting mis-attribution of time is a bug.  And if it is empty but we still get unexpectedly long soft reference processing times then this hypothesis is falsified.
>> 
>> I don’t yet see a way to tell whether the mark stack is empty or to correct the time attribution that doesn’t involve patching the source code and rebuilding.
> 
> Thanks for looking into this.
> 
> We are open to patching, rebuilding and testing, if we get guidance on
> the repo to pull or other instructions to build the modified version.
> Let us know if you have either modified code or indications for us to
> modify the code.

I’m going to try to come up with a patch that you could try.  You probably mentioned somewhere what Java version you are using, but I couldn’t find it.  Having that would give me the starting point for making a patch.



More information about the hotspot-gc-use mailing list