You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "zhengchenyu (via GitHub)" <gi...@apache.org> on 2024/09/12 07:58:23 UTC
[I] [Improvement] Use DirectBufferNoCleanerConstructor for Netty In JDK11 [incubator-uniffle]
zhengchenyu opened a new issue, #2116:
URL: https://github.com/apache/incubator-uniffle/issues/2116
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
### Search before asking
- [X] I have searched in the [issues](https://github.com/apache/incubator-uniffle/issues?q=is%3Aissue) and found no similar issues.
### What would you like to be improved?
Initially, under k8s deployment, that is jdk11, I found used_direct_memory_size was always -2.
I found debug log `[main] [DEBUG] PlatformDependent0.<clinit> - direct buffer constructor: unavailable`. It means we will use DirectByteBuffer constructor with cleaner, then means that `Netty will not enforce max memory, and instead will defer to JDK.`
I search the code, found that netty have two ways:
## (1) use jdk cleaner
* Netty will not limit the memory.
* We should use `-XX:MaxDirectMemorySize` to limit DirectByteBuffer. If the limit is reached, GC is triggered.
* We should use metric: `jvm_buffer_pool_used_bytes{pool="direct"}`
## (2) do not use jdk cleaner
* Netty will limit memory with `io.netty.maxDirectMemory`. If the limit is reached, will throw exception.
* We can also use `-XX:MaxDirectMemorySize` to limit DirectByteBuffer, but the usage should be very low. I think there are no need to limit.
* We should use metrics: `used_direct_memory_size`
> BTW, the native memory used in FileOuputStream can not be limited and monitored. We should avoid that.
### How should we improve?
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a 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@uniffle.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [I] [Improvement] Whether to use jdk cleaner for netty. [incubator-uniffle]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on issue #2116:
URL: https://github.com/apache/incubator-uniffle/issues/2116#issuecomment-2345610109
@maobaolong @rickyma
--
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@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [I] [Improvement] Whether to use jdk cleaner for netty. [incubator-uniffle]
Posted by "zhengchenyu (via GitHub)" <gi...@apache.org>.
zhengchenyu commented on issue #2116:
URL: https://github.com/apache/incubator-uniffle/issues/2116#issuecomment-2346621108
The test shows that (1) and (2) are the same. When the limit is reached, the server will be stuck. Personally think that (1) or (2) it doesn't matter, suggest not to max direct limit, but via `rss.server.buffer.capacity` limit. So end this nonsense.
--
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@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [I] [Improvement] Whether to use jdk cleaner for netty. [incubator-uniffle]
Posted by "zhengchenyu (via GitHub)" <gi...@apache.org>.
zhengchenyu closed issue #2116: [Improvement] Whether to use jdk cleaner for netty.
URL: https://github.com/apache/incubator-uniffle/issues/2116
--
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@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [I] [Improvement] Whether to use jdk cleaner for netty. [incubator-uniffle]
Posted by "maobaolong (via GitHub)" <gi...@apache.org>.
maobaolong commented on issue #2116:
URL: https://github.com/apache/incubator-uniffle/issues/2116#issuecomment-2347737826
@jerqi @zhengchenyu In practice, we set both `MaxDirectMemorySize` and `rss.server.buffer.capacity`, and `MaxDirectMemorySize` is larger than `rss.server.buffer.capacity`.
--
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@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [I] [Improvement] Whether to use jdk cleaner for netty. [incubator-uniffle]
Posted by "zhengchenyu (via GitHub)" <gi...@apache.org>.
zhengchenyu commented on issue #2116:
URL: https://github.com/apache/incubator-uniffle/issues/2116#issuecomment-2345541905
In my practice, I prefer to not use jdk cleaner. If memory is not enough, we will throw the exception to prompt user.
But if use jdk cleaner, I found that server will stuck because of full gc can not free the direct memory.
--
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@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org