You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "smengcl (via GitHub)" <gi...@apache.org> on 2026/05/24 07:16:14 UTC

[PR] HDDS-11234. Manage Netty native memory consumption [ozone]

smengcl opened a new pull request, #10354:
URL: https://github.com/apache/ozone/pull/10354

   ## What changes were proposed in this pull request?
   
   Adds two opt-in env vars in `ozone_java_setup` to cap Netty's pooled direct memory:
   
   - `OZONE_NETTY_MAX_DIRECT_MEMORY` sets `-Dio.netty.maxDirectMemory=<bytes>` (unshaded `io.netty`, used by S3G/gRPC).
   - `OZONE_RATIS_NETTY_MAX_DIRECT_MEMORY` sets `-Dorg.apache.ratis.thirdparty.io.netty.maxDirectMemory=<bytes>` (Ratis-shaded copy, used by DN write/replication).
   
   Two variables are needed because the unshaded and Ratis-shaded Netty classes have independent allocators, each defaulting to `≈ -Xmx` — so the implicit per-process ceiling is roughly `2 × -Xmx` of direct memory.
   
   Both env vars are unset by default. No behavior change unless operators set them.
   
   Companion docs PR in `apache/ozone-site` adds `docs/06-troubleshooting/17-netty-direct-memory.md`.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-11234
   
   ## How was this patch tested?
   
   - Manually confirmed each `-D` lands in the correct `OPTS` var.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11234. Manage Netty native memory consumption [ozone]

Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl closed pull request #10354: HDDS-11234. Manage Netty native memory consumption
URL: https://github.com/apache/ozone/pull/10354


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11234. Manage Netty native memory consumption [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #10354:
URL: https://github.com/apache/ozone/pull/10354#discussion_r3304795323


##########
hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
##########
@@ -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.

Review Comment:
   #10030 is too big and should be split
   
   https://github.com/apache/ozone/pull/10030#pullrequestreview-4051473327
   https://github.com/apache/ozone/pull/10030#issuecomment-4193618479



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11234. Manage Netty native memory consumption [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #10354:
URL: https://github.com/apache/ozone/pull/10354


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11234. Manage Netty native memory consumption [ozone]

Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on PR #10354:
URL: https://github.com/apache/ozone/pull/10354#issuecomment-4568641695

   Thanks @jojochuang  @adoroszlai  @yandrey321 for reviewing this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11234. Manage Netty native memory consumption [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on code in PR #10354:
URL: https://github.com/apache/ozone/pull/10354#discussion_r3304398892


##########
hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
##########
@@ -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.

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11234. Manage Netty native memory consumption [ozone]

Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on code in PR #10354:
URL: https://github.com/apache/ozone/pull/10354#discussion_r3314709474


##########
hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
##########
@@ -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.

Review Comment:
   Ah I misunderstood earlier. Let me reopen this PR



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11234. Manage Netty native memory consumption [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #10354:
URL: https://github.com/apache/ozone/pull/10354#issuecomment-4564405091

   > We need to document these params and have a guide for how to use them.
   
   @yandrey321 see https://github.com/apache/ozone-site/pull/448/files


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11234. Manage Netty native memory consumption [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #10354:
URL: https://github.com/apache/ozone/pull/10354#issuecomment-4566023388

   Thanks @smengcl for the patch, @jojochuang, @yandrey321 for the review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11234. Manage Netty native memory consumption [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #10354:
URL: https://github.com/apache/ozone/pull/10354#discussion_r3304795323


##########
hadoop-ozone/dist/src/shell/ozone/ozone-functions.sh:
##########
@@ -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.

Review Comment:
   #10030 is too big and should be split



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11234. Manage Netty native memory consumption [ozone]

Posted by "smengcl (via GitHub)" <gi...@apache.org>.
smengcl commented on PR #10354:
URL: https://github.com/apache/ozone/pull/10354#issuecomment-4550832658

   I'm closing this one atm to wait for https://github.com/apache/ozone/pull/10030 to land then. cc @yandrey321


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org