-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Derive direct memory used count from netty counter #223
Conversation
23084ad
to
6f9d200
Compare
private static Field directMemoryUsage = null; | ||
static { | ||
try { | ||
directMemoryUsage = PlatformDependent.class.getDeclaredField("DIRECT_MEMORY_COUNTER"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's called a counter.. does it go down when the memory is released? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, updated test-case with the release
call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
6f9d200
to
8d0df29
Compare
Can we patch 1.16 as well? |
8d0df29
to
c4ce429
Compare
* Derive direct memory used count from netty counter * Fix: avoid initial direct-memory assertion with 0
yes. |
Motivation
As mentioned at #222 :
JvmMetrics
doesn't return correct jvm_direct_memory_usedModifications
Get the directMemoryUsed count from Netty-
PlatformDependent
counter.Result
JvmMetrics
provides correct directMemoryUsed metric.