New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feautre request] Add a util method to get maxDirectMemory #12103
Comments
@chrisvest what do you think... Not sure we want to expose just another public method. I guess we could do it tho |
@normanmaurer it's -1 to me, but I would like to understand why @shoothzj need it/the exact use case |
@franz1981 It's started with apache/bookkeeper#2989 when locating a Please point out if I didn't make it clear. My English is not good. Thanks |
wdyt @normanmaurer ? I know that Netty's |
@normanmaurer @franz1981 I don't see a big problem in exposing |
technically it wouldn't even be part of the public API, last I recall PlatformDependent is in the "internal" package, that said could annotate it as UnstableApi? |
Let's wait what @normanmaurer answer on this, but I like both @chrisvest and @johnou answers |
Motivation: Integrators may want to also have a cross-platform way to compute the max direct memory. Since we do this already, we can just as well expose the method. However, all methods in PlatformDependent remain internal and unsupported, so callers should be robust to changing signatures and method names. Modification: Rename the maxDirectMemory0 method to estimateMaxDirectMemory and make it public. Result: Fixes netty#12103
Motivation: Integrators may want to also have a cross-platform way to compute the max direct memory. Since we do this already, we can just as well expose the method. However, all methods in PlatformDependent remain internal and unsupported, so callers should be robust to changing signatures and method names. Modification: Rename the maxDirectMemory0 method to estimateMaxDirectMemory and make it public. Result: Fixes #12103
Motivation: Integrators may want to also have a cross-platform way to compute the max direct memory. Since we do this already, we can just as well expose the method. However, all methods in PlatformDependent remain internal and unsupported, so callers should be robust to changing signatures and method names. Modification: Rename the maxDirectMemory0 method to estimateMaxDirectMemory and make it public. Result: Fixes #12103
Motivation: Integrators may want to also have a cross-platform way to compute the max direct memory. Since we do this already, we can just as well expose the method. However, all methods in PlatformDependent remain internal and unsupported, so callers should be robust to changing signatures and method names. Modification: Rename the maxDirectMemory0 method to estimateMaxDirectMemory and make it public. Result: Fixes netty#12103
Motivation: Integrators may want to also have a cross-platform way to compute the max direct memory. Since we do this already, we can just as well expose the method. However, all methods in PlatformDependent remain internal and unsupported, so callers should be robust to changing signatures and method names. Modification: Rename the maxDirectMemory0 method to estimateMaxDirectMemory and make it public. Result: Fixes netty#12103
Netty's
PlatformDependent.maxDirectMemory()
is powerful and general.In other project, we want to read the
maxDirectMemory
too.But we can't directly use
PlatformDependent.maxDirectMemory()
, because it will wrong if user setio.netty.maxDirectMemory
greater than zero.Instead of copy and paste netty's code(Under Apache License), I want a UtilityClass to get
PlatformDependent.maxDirectMemory0
result.I am not very familiar with netty code, I can work on this under guides.
Thanks for your help.
The text was updated successfully, but these errors were encountered: