JDK-8370325 : G1: Disallow GC for TLAB allocation
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-10-21
  • Updated: 2025-12-17
  • Resolved: 2025-10-23
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 17 JDK 21 JDK 25 JDK 26
17.0.19-oracleFixed 21.0.11-oracleFixed 25.0.3-oracleFixed 26 b22Fixed
Related Reports
Blocks :  
Description
In G1, during allocation of an object currently there are two locations where a GC can occur:

- during TLAB allocation (i.e. refill)
- during the following allocation outside TLAB

This behavior breaks UseGCOverheadLimit support planned in JDK-8212084: if the overhead limit triggers because of TLAB allocation, returning null, the following allocation outside tlab may succeed (due to how UseGCOverheadLimit works, one is required to actually perform the collections), effectively making this feature non-working.

Fix is to not allow a garbage collection during TLAB allocation, deferring to the following outside-tlab allocation.
Still, TLAB allocation should still try to allocate a new allocation region.
Comments
Fix request [25u,21u] I backport this for parity with 25.0.3-oracle,21.0.11-oracle. Medium risk. Affects default GC and intends change of behaviour. Nevertheless let's go along, especially with follow-up JDK-8212084 so that tuning of OpenJDK works similarly. Needed trivial resolve in 25. 25->21 clean. SAP nightly testing passed.
11-12-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/2514 Date: 2025-12-10 13:57:35 +0000
10-12-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk25u-dev/pull/64 Date: 2025-12-04 15:56:47 +0000
04-12-2025

Changeset: 027aea9d Branch: master Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2025-10-23 07:05:08 +0000 URL: https://git.openjdk.org/jdk/commit/027aea9d2e0dff29fcd00fa7074ca955066929ec
23-10-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/27932 Date: 2025-10-22 07:59:12 +0000
22-10-2025