File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2018, 2025 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2018, 2026 , Oracle and/or its affiliates. All rights reserved.
33 * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
44 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55 *
@@ -209,6 +209,17 @@ void G1Arguments::initialize() {
209209 FLAG_SET_DEFAULT (GCTimeRatio, 24 );
210210 }
211211
212+ // Do not interfere with GC-Pressure driven heap resizing unless the user
213+ // explicitly sets otherwise. G1 heap sizing should be free to grow or shrink
214+ // the heap based on GC pressure, rather than being forced to satisfy
215+ // MinHeapFreeRatio or MaxHeapFreeRatio defaults that the user did not set.
216+ if (FLAG_IS_DEFAULT (MinHeapFreeRatio)) {
217+ FLAG_SET_DEFAULT (MinHeapFreeRatio, 0 );
218+ }
219+ if (FLAG_IS_DEFAULT (MaxHeapFreeRatio)) {
220+ FLAG_SET_DEFAULT (MaxHeapFreeRatio, 100 );
221+ }
222+
212223 // Below, we might need to calculate the pause time interval based on
213224 // the pause target. When we do so we are going to give G1 maximum
214225 // flexibility and allow it to do pauses when it needs to. So, we'll
You can’t perform that action at this time.
0 commit comments