[ISSUE 2637] Fix jvm_memory_direct_bytes_used metrics when using jdk11+ - #3252
Merged
Conversation
Member
Author
|
rerun failure checks |
dlg99
reviewed
Apr 29, 2022
dlg99
left a comment
Contributor
There was a problem hiding this comment.
Is there a more officially supported way of doing this?
mx bean or something like that.
E.g. I can't tell if this works in JDK 17 or the next one.
Contributor
|
e.g. see #3234 : "Starting from JDK17 the reflection is not allowed in the jdk internals modules" |
hezhangjian
force-pushed
the
issue-2637
branch
3 times, most recently
from
April 29, 2022 08:30
33e9b35 to
33e3e3b
Compare
hangc0276
approved these changes
Jun 24, 2022
zymap
pushed a commit
that referenced
this pull request
Aug 1, 2022
…1+ (#3252) Fix #2637 #3247 ### Motivation The mertics about `jvm_memory_direct_bytes_used` is acquired by netty's `PlatformDependent#DIRECT_MEMORY_COUNTER`. Which can only acquired the memory used by netty. ### Changes - use `java.nio.Bits#RESERVED_MEMORY` for jvm direct memory metrics. - add tests to ensure `jvm_memory_direct_bytes_max` and `jvm_memory_direct_bytes_used` gets value. (cherry picked from commit cefe9d4)
hangc0276
pushed a commit
to hangc0276/bookkeeper
that referenced
this pull request
Nov 7, 2022
…1+ (apache#3252) Fix apache#2637 apache#3247 ### Motivation The mertics about `jvm_memory_direct_bytes_used` is acquired by netty's `PlatformDependent#DIRECT_MEMORY_COUNTER`. Which can only acquired the memory used by netty. ### Changes - use `java.nio.Bits#RESERVED_MEMORY` for jvm direct memory metrics. - add tests to ensure `jvm_memory_direct_bytes_max` and `jvm_memory_direct_bytes_used` gets value. (cherry picked from commit cefe9d4)
hangc0276
pushed a commit
to hangc0276/bookkeeper
that referenced
this pull request
Nov 7, 2022
…1+ (apache#3252) Fix apache#2637 apache#3247 ### Motivation The mertics about `jvm_memory_direct_bytes_used` is acquired by netty's `PlatformDependent#DIRECT_MEMORY_COUNTER`. Which can only acquired the memory used by netty. ### Changes - use `java.nio.Bits#RESERVED_MEMORY` for jvm direct memory metrics. - add tests to ensure `jvm_memory_direct_bytes_max` and `jvm_memory_direct_bytes_used` gets value. (cherry picked from commit cefe9d4)
Member
|
This may be a breaking change, after this pr. The old user who used jdk8 didn't record the direct memory metrics. |
nicoloboschi
pushed a commit
to datastax/bookkeeper
that referenced
this pull request
Jan 11, 2023
…1+ (apache#3252) Fix apache#2637 apache#3247 ### Motivation The mertics about `jvm_memory_direct_bytes_used` is acquired by netty's `PlatformDependent#DIRECT_MEMORY_COUNTER`. Which can only acquired the memory used by netty. ### Changes - use `java.nio.Bits#RESERVED_MEMORY` for jvm direct memory metrics. - add tests to ensure `jvm_memory_direct_bytes_max` and `jvm_memory_direct_bytes_used` gets value. (cherry picked from commit cefe9d4) (cherry picked from commit 523ffcf)
Ghatage
pushed a commit
to sijie/bookkeeper
that referenced
this pull request
Jul 12, 2024
…1+ (apache#3252) Fix apache#2637 apache#3247 ### Motivation The mertics about `jvm_memory_direct_bytes_used` is acquired by netty's `PlatformDependent#DIRECT_MEMORY_COUNTER`. Which can only acquired the memory used by netty. ### Changes - use `java.nio.Bits#RESERVED_MEMORY` for jvm direct memory metrics. - add tests to ensure `jvm_memory_direct_bytes_max` and `jvm_memory_direct_bytes_used` gets value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #2637 #3247
Motivation
The mertics about
jvm_memory_direct_bytes_usedis acquired by netty'sPlatformDependent#DIRECT_MEMORY_COUNTER. Which can only acquired the memory used by netty.Changes
java.nio.Bits#RESERVED_MEMORYfor jvm direct memory metrics.jvm_memory_direct_bytes_maxandjvm_memory_direct_bytes_usedgets value.