Skip to content

HDDS-11234. Manage Netty native memory consumption#10354

Closed
smengcl wants to merge 1 commit into
apache:masterfrom
smengcl:HDDS-11234-config
Closed

HDDS-11234. Manage Netty native memory consumption#10354
smengcl wants to merge 1 commit into
apache:masterfrom
smengcl:HDDS-11234-config

Conversation

@smengcl
Copy link
Copy Markdown
Contributor

@smengcl smengcl commented May 24, 2026

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: apache/ozone-site#448

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.

Comment on lines +1423 to +1426
# 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.
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)

@smengcl
Copy link
Copy Markdown
Contributor Author

smengcl commented May 27, 2026

I'm closing this one atm to wait for #10030 to land then. cc @yandrey321

@smengcl smengcl closed this May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants