Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2204300 | 7 | Tony Printezis | P3 | Closed | Fixed | b123 |
JDK-2205842 | 6u25 | Tony Printezis | P3 | Resolved | Fixed | b01 |
When we cannot do a GC because is GC locker is active, the general approach is to do allocations in the old generation (via the slow allocation path) until all the threads drain from the GC locker and a GC locker-induced GC is scheduled.
In G1, the GC locker is supposed to be the only cause of direct allocations into the old generation (there are currently some bugs that can invalidate this assumption; the fix for 6974966 will eliminate those cases). If we avoid doing direct-to-old allocations alltogether would simplify the code quite a lot. So, instead of direct-to-old allocations we are going to do something different. When the eden is ful, but a GC attempt fails due to the GC locker being active, what we'll do is we'll extend the eden further while we are waiting for the threads in the critical section to drain out of the GC locker and the GC locker to schedule a GC.
There will be a (user-settable) upper bound on how much the eden can grow over its intended size (so that it does not grow out of control). If we reach that, threads that want to allocate will stall until the GC locker-induced GC completes. Hopefully, this will be very rare. Most of the time, we'll only need to extend the eden by a region or two as the GC locker critical sections tend to be reasonable short.
Notice that this should be an improvement on what other GCs do today, which is to take the slow allocation path to allocate every object into the old generation. By extending the eden G1 will be able to support TLAB allocations while the GC locker is active which should have no overhead on the application threads.
In G1, the GC locker is supposed to be the only cause of direct allocations into the old generation (there are currently some bugs that can invalidate this assumption; the fix for 6974966 will eliminate those cases). If we avoid doing direct-to-old allocations alltogether would simplify the code quite a lot. So, instead of direct-to-old allocations we are going to do something different. When the eden is ful, but a GC attempt fails due to the GC locker being active, what we'll do is we'll extend the eden further while we are waiting for the threads in the critical section to drain out of the GC locker and the GC locker to schedule a GC.
There will be a (user-settable) upper bound on how much the eden can grow over its intended size (so that it does not grow out of control). If we reach that, threads that want to allocate will stall until the GC locker-induced GC completes. Hopefully, this will be very rare. Most of the time, we'll only need to extend the eden by a region or two as the GC locker critical sections tend to be reasonable short.
Notice that this should be an improvement on what other GCs do today, which is to take the slow allocation path to allocate every object into the old generation. By extending the eden G1 will be able to support TLAB allocations while the GC locker is active which should have no overhead on the application threads.
- backported by
-
JDK-2205842 G1: when GC locker is active, extend the Eden instead of allocating into the old gen
- Resolved
-
JDK-2204300 G1: when GC locker is active, extend the Eden instead of allocating into the old gen
- Closed
- relates to
-
JDK-6974966 G1: unnecessary direct-to-old allocations
- Closed
-
JDK-7005137 G1: Dynamically adjust allocation reserve
- Open
-
JDK-6977804 G1: remove the zero-filling thread
- Closed
-
JDK-7005234 G1: Artificially reduce the TLAB size when expanding the eden due to the GC locker
- Closed
(1 relates to)