Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions hadoop-hdds/common/src/main/conf/ozone-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,21 @@ export OZONE_OS_TYPE=${OZONE_OS_TYPE:-$(uname -s)}
# to keep OZONE_IDENT_STRING untouched, then uncomment this line.
# export OZONE_SECURE_IDENT_PRESERVE="true"

###
# Netty native (direct) memory caps (HDDS-11234)
###
# Both unshaded io.netty and the Ratis-shaded copy default their pooled
# direct-memory ceiling to MaxDirectMemorySize (≈ -Xmx) per JVM, which
# can let the resident size of a busy DataNode or S3 Gateway grow well
# beyond the heap. To put a hard cap on each pool, export one or both
# of the following before starting Ozone daemons. Values are raw byte
# counts (suffixes like "m" or "g" are NOT supported by Netty's
# property parser); for example, 536870912 = 512 MiB.
#
# For example, to cap each pool at 4 GiB on a DataNode with -Xmx16g:
# export OZONE_NETTY_MAX_DIRECT_MEMORY=4294967296
# export OZONE_RATIS_NETTY_MAX_DIRECT_MEMORY=4294967296

###
# Ozone Manager specific parameters
###
Expand Down
11 changes: 11 additions & 0 deletions hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,17 @@ function ozone_java_setup
RATIS_OPTS="-Dorg.apache.ratis.thirdparty.io.netty.tryReflectionSetAccessible=true ${RATIS_OPTS}"
fi

# Opt-in caps on Netty's pooled direct-memory arena (HDDS-11234). Two
# properties are needed because Ozone runs both the unshaded io.netty
# *and* the Ratis-shaded copy in the same JVM, each with its own
# independent ceiling.
Comment on lines +1423 to +1426
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we might be able to simplify it after #10030 which supposedly migrates gRPC usage to Ratis-shaded gRPC.

Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai May 26, 2026

Choose a reason for hiding this comment

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

#10030 is too big and should be split

#10030 (review)
#10030 (comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah I misunderstood earlier. Let me reopen this PR

if [[ -n "${OZONE_NETTY_MAX_DIRECT_MEMORY:-}" ]]; then
OZONE_OPTS="-Dio.netty.maxDirectMemory=${OZONE_NETTY_MAX_DIRECT_MEMORY} ${OZONE_OPTS}"
fi
if [[ -n "${OZONE_RATIS_NETTY_MAX_DIRECT_MEMORY:-}" ]]; then
RATIS_OPTS="-Dorg.apache.ratis.thirdparty.io.netty.maxDirectMemory=${OZONE_RATIS_NETTY_MAX_DIRECT_MEMORY} ${RATIS_OPTS}"
fi

ozone_set_module_access_args
}

Expand Down