Replies: 2 comments 7 replies
-
The JDK limit only applies to direct ByteBuffers. Other allocation paths to native memory, like JNI and Unsafe, are not accounted in that JDK limit. |
Beta Was this translation helpful? Give feedback.
-
Regarding the original question, about how the memory is accounted when The script is launched with The test allocate and check the allocated direct memory (using JMX). The test executes these steps:
Is not clear to me why the direct memory that Netty allocates with Unsafe is accounted under the NIO direct space when |
Beta Was this translation helpful? Give feedback.
-
With commit 3d29bcf was introduced the property
io.netty.maxDirectMemory
to limit the usage of direct memory. As I can understand this limit defines a limit for all Netty's direct memory allocation both pooled and unpooled.Regarding the case
< 0
:netty/common/src/main/java/io/netty/util/internal/PlatformDependent.java
Lines 153 to 156 in dc16c58
Given that there is an hard limit imposed by the JVM (
MaxDirectMemorySize
) on how much direct memory the process can use, how is it possible that is uses twice the max memory as defined by the JDK?Beta Was this translation helpful? Give feedback.
All reactions