JDK-8314573 : G1: Heap resizing at Remark does not take existing eden regions into account
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 12,17,21,22
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-08-18
  • Updated: 2024-09-23
  • Resolved: 2023-08-29
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 21 JDK 22
21.0.4Fixed 22 b13Fixed
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8322397 :  
Description
During the Remark pause we use the full gc heap resizing policy.

One important metric is the amount of free space/regions at that point; it is calculated as

  const size_t used_after_gc = capacity_after_gc - _g1h->unused_committed_regions_in_bytes();

The problem with that formula is that at the point when the Remark pause occurs, Eden is not empty compared to full gc.

So the result of this calculation is very dependent on the point in time the Remark pause occurs, and so is the result whether g1 expands the heap or not. The suggestion is to incorporate current eden size as well.

Introduced in JDK-6490394.

This can cause lots of unnecessary heap expansions and heap usage.
Comments
[jdk21u-fix-request] Approval Request from Liang Mao Clean backport of fix of G1 Heap resizing heuristics at remark. Risk is low which only affects the heuristics.
01-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/429 Date: 2024-04-01 08:57:42 +0000
01-04-2024

Changeset: 762b6529 Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2023-08-29 14:20:11 +0000 URL: https://git.openjdk.org/jdk/commit/762b652912939b37fbd68955617705c62b9fc3a5
29-08-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15400 Date: 2023-08-23 09:54:41 +0000
23-08-2023