JDK-8052167 : G1 wrongly counts PLABs not allocated in the originally intended allocation "generation"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2014-07-28
  • Updated: 2015-01-19
  • Resolved: 2015-01-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9Resolved
Related Reports
Duplicate :  
Description
When memory is tight during PLAB allocation, G1 attempts to allocate survivor and old gen PLABs in the other memory area (i.e. survivor PLAB in old gen).

However the caller of the method that handles this (G1CollectedHeap::par_allocate_during_gc()) does not take into account that the returned PLAB buffer might be in the wrong memory area.
Regardless of the memory area, PLAB statistics are accounted for the requested memory area only.

E.g. GC tries to allocate a PLAB from survivor, but gets one from old gen regions. Still the allocation statistics are accounted as if that PLAB were from survivor region.

This results in bad statistics like the gc thinking that it allocated more memory into survivor than the survivor is large.

Also, we may consider removing the ability to allocate old gen PLAB in survivor: there is not much to gain here since G1 assigns regions lazily, so at most the memory of a single region may be left unused before the inevitable full gc. This is different in the other generational collectors where the allocation is much more strict.
Comments
Fixed in JDK-8060025: this situation cannot occur any more. If we cannot allocate in Old gen, we never try to allocate in survivor space. The situation where old gen is full, and survivor space is not, is one that will give an almost guaranteed full gc anyway. See G1ParScanThreadState::allocate_in_next_plab().
19-01-2015

I=M, causes some issues for PLAB sizing L=L, only occurs if memory is very tight W=H, no known workaround MLH=>P4
29-07-2014