File tree Expand file tree Collapse file tree
hadoop-hdds/common/src/main/conf
hadoop-ozone/dist/src/shell/ozone Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -248,6 +248,21 @@ export OZONE_OS_TYPE=${OZONE_OS_TYPE:-$(uname -s)}
248248# Java property: hadoop.log.dir
249249# export OZONE_SECURE_LOG_DIR=${OZONE_LOG_DIR}
250250
251+ # ##
252+ # Netty native (direct) memory caps (HDDS-11234)
253+ # ##
254+ # Both unshaded io.netty and the Ratis-shaded copy default their pooled
255+ # direct-memory ceiling to MaxDirectMemorySize (≈ -Xmx) per JVM, which
256+ # can let the resident size of a busy DataNode or S3 Gateway grow well
257+ # beyond the heap. To put a hard cap on each pool, export one or both
258+ # of the following before starting Ozone daemons. Values are raw byte
259+ # counts (suffixes like "m" or "g" are NOT supported by Netty's
260+ # property parser); for example, 536870912 = 512 MiB.
261+ #
262+ # For example, to cap each pool at 4 GiB on a DataNode with -Xmx16g:
263+ # export OZONE_NETTY_MAX_DIRECT_MEMORY=4294967296
264+ # export OZONE_RATIS_NETTY_MAX_DIRECT_MEMORY=4294967296
265+
251266# ##
252267# Ozone Manager specific parameters
253268# ##
Original file line number Diff line number Diff line change @@ -1420,6 +1420,17 @@ function ozone_java_setup
14201420 RATIS_OPTS=" -Dorg.apache.ratis.thirdparty.io.netty.tryReflectionSetAccessible=true ${RATIS_OPTS} "
14211421 fi
14221422
1423+ # Opt-in caps on Netty's pooled direct-memory arena (HDDS-11234). Two
1424+ # properties are needed because Ozone runs both the unshaded io.netty
1425+ # *and* the Ratis-shaded copy in the same JVM, each with its own
1426+ # independent ceiling.
1427+ if [[ -n " ${OZONE_NETTY_MAX_DIRECT_MEMORY:- } " ]]; then
1428+ OZONE_OPTS=" -Dio.netty.maxDirectMemory=${OZONE_NETTY_MAX_DIRECT_MEMORY} ${OZONE_OPTS} "
1429+ fi
1430+ if [[ -n " ${OZONE_RATIS_NETTY_MAX_DIRECT_MEMORY:- } " ]]; then
1431+ RATIS_OPTS=" -Dorg.apache.ratis.thirdparty.io.netty.maxDirectMemory=${OZONE_RATIS_NETTY_MAX_DIRECT_MEMORY} ${RATIS_OPTS} "
1432+ fi
1433+
14231434 ozone_set_module_access_args
14241435}
14251436
You can’t perform that action at this time.
0 commit comments