DB-2993: export used direct memory#14
DB-2993: export used direct memory#14stef1927 merged 3 commits intoriptano:dse-netty-4.1.13.Finalfrom
Conversation
|
Any reason not to do this on main netty repo? |
The patch adds JVM allocations to |
sbtourist
left a comment
There was a problem hiding this comment.
LGTM, just left a couple minor comments.
| PlatformDependent0.setMemory(address, bytes, value); | ||
| } | ||
|
|
||
| public static ByteBuffer allocateDirect(int capacity) { |
There was a problem hiding this comment.
Why the "allocate" method has no Buffer suffix and vice versa for "free"?
There was a problem hiding this comment.
freeDirectBuffer() was an existing method, hence the confusion. Renamed, thanks.
| } | ||
|
|
||
| /** | ||
| * Allocate a new {@link ByteBuffer} with the given {@code capacity}. {@link ByteBuffer}s allocated with |
There was a problem hiding this comment.
I'm not sure why the JVM suffix versus calling it something like allocateDirectWithCleaner, but either ways this javadoc seems wrong as the method to free the buffer should be freeDirectBufferJVM right?
There was a problem hiding this comment.
Renamed and fixed javadoc, thanks.
tjake
left a comment
There was a problem hiding this comment.
I had the same comment about the javadoc
|
Thanks for the review. I've renamed the allocate and free methods and bumped the version. |
I redirected the JVM NIO direct buffer allocations to
PlatformDependentso long as these buffers were cleaned viaPlatformDependent.I've also changed
PlatformDependentto measure allocated memory even when using the JVM NIO direct allocations. I then exported the memory allocated withPlatformDependent.usedDirectMemory(). The idea is to read this value in our own native memory metrics.@sbtourist or @tjake would you be able to review?
cc @snazy