Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1525,8 +1525,8 @@ function ozone_add_default_gc_opts
if [[ ! "$OZONE_OPTS" =~ "-XX" ]] ; then
OZONE_OPTS="${OZONE_OPTS} -XX:ParallelGCThreads=8"
if [[ "$java_major_version" -lt 15 ]]; then
OZONE_OPTS="${OZONE_OPTS} -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled"
ozone_error "No '-XX:...' jvm parameters are set. Adding safer GC settings '-XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled' to the OZONE_OPTS"
OZONE_OPTS="${OZONE_OPTS} -XX:+UseConcMarkSweepGC -XX:NewRatio=3 -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would be the equivalent for G1GC?

Copy link
Contributor Author

@rnblough rnblough Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happily there isn't one. The root cause of the problem is an ergonomic detail unique to CMS, from which G1GC does not suffer. This isn't even a bug, it is intended behavior, just from 2004 when there was nothing like modern scale challenges or the individual server resources to meet them.

If we switch to the question of "can G1GC performance be improved with this property" the answer is no as I understand it; G1GC depends on adaptive sizing of the young gen for meeting the pause goals that are set. Any property that fixes the young gen heap size, whether NewRatio, Xmn, or NewSize=MaxNewSize, would stop that mechanism from working. This wouldn't break G1GC, but it would likely mean that we would start consistently exceeding its pause target above some threshold.

ozone_error "No '-XX:...' jvm parameters are set. Adding safer GC settings '-XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC -XX:NewRatio=3 -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled' to the OZONE_OPTS"
else
ozone_error "No '-XX:...' jvm parameters are set. Adding safer GC settings '-XX:ParallelGCThreads=8' to the OZONE_OPTS"
fi
Expand Down
Loading