JDK-8329223 : Parallel: Parallel GC resizes heap even if -Xms = -Xmx
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 17,21,22,23
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-03-27
  • Updated: 2024-10-24
  • Resolved: 2024-04-30
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 22 JDK 23
17.0.12Fixed 21.0.4Fixed 22.0.2Fixed 23 b21Fixed
Related Reports
Relates :  
Relates :  
Description
Run gcold test with following parameter:

-Xms256m -Xmx256m -XX:+UseParallelGC -Xlog:gc -Xlog:os+map=trace -cp classes gc.stress.gcold.TestGCOld 40 1 20 10 200000 

gc log shows parallel GC resizes heap:

[2.169s][info ][gc    ] GC(247) Pause Young (Allocation Failure) 249M->172M(252M) 1.034ms
[2.177s][info ][gc    ] GC(248) Pause Young (Allocation Failure) 250M->173M(252M) 0.962ms
[2.188s][info ][gc    ] GC(249) Pause Young (Allocation Failure) 251M->173M(252M) 0.992ms
[2.213s][debug][os,map] Uncommitted [0x00000007f7d00000 - 0x00000007fab00000), (48234496 bytes) <== shrink old gen
[2.213s][debug][os,map] Uncommitted [0x0000000102f08000 - 0x0000000102f20000), (98304 bytes)
[2.213s][debug][os,map] Uncommitted [0x0000000102e88000 - 0x0000000102e9c000), (81920 bytes)
[2.213s][info ][gc    ] GC(250) Pause Full (Ergonomics) 251M->55M(206M) 18.515ms 
[2.220s][info ][gc    ] GC(251) Pause Young (Allocation Failure) 133M->58M(206M) 1.073ms
[2.231s][info ][gc    ] GC(252) Pause Young (Allocation Failure) 136M->59M(206M) 1.288ms

Comments
[jdk21u-fix-request] Approval Request from Ben Taylor Clean backport of a low-risk change to address unexpected behavior with Parallel GC when Xms == Xmx.
21-05-2024

@btaylor I think you have to backport to 21u before requesting backport to 17u
21-05-2024

[jdk17u-fix-request] Approval Request from Ben Taylor Clean backport of a low-risk change to address unexpected behavior with Parallel GC when Xms == Xmx.
17-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/587 Date: 2024-05-17 19:43:04 +0000
17-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/2480 Date: 2024-05-17 19:43:06 +0000
17-05-2024

Fix Request (22u) I would like to backport this patch to 22u. User does not expect heap resizing when -Xms = -Xmx, it is an unpleasant surprise to user. It is a clean backport and risk is low.
13-05-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk22u/pull/200 Date: 2024-05-13 15:07:13 +0000
13-05-2024

Changeset: aca1e836 Author: Zhengyu Gu <zgu@openjdk.org> Date: 2024-04-30 16:20:10 +0000 URL: https://git.openjdk.org/jdk/commit/aca1e8365bf0f64bf18caf798bbca1d25b3c4117
30-04-2024

This ticket also looks related.
15-04-2024

Another small producer: `java -XX:+UseParallelGC -Xms256m -Xmx256m '-Xlog:gc,gc+heap=trace' --version`: [0.022s][trace][gc,heap] Minimum old 524288 Initial old 179306496 Maximum old 179306496 Note the min-old-size is 524288, but should be 179306496.
15-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/18539 Date: 2024-03-28 19:21:01 +0000
28-03-2024