Why DirectMemory In Java Heap ?
See original GitHub issueI use a code without release like OutOfDirectMemoryError
when Stress test it by jmeter and see it by Jconsole.
this is a DirectMemoryError, why Heap is full and directMemory is empty?
Netty version
4.1.65
JVM version (e.g. java -version
)
❯ java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
What is the purpose to use direct memory in Java?
Direct memory was introduced since java 1.4.
Read more >Memory management
Direct memory, which is part of the Java process heap, is separate from the object heap allocated by -Xmx . The value allocated...
Read more >Troubleshooting OutOfMemoryError: Direct buffer memory
As we said, the Direct Buffers are allocated to native memory space outside of the JVM's established heap/perm gens. If this memory space ......
Read more >Understanding the JVM Memory Model — Heap vs. Non-Heap
Memory allocated inside the stack can only be accessed within the thread's context, making it safer — no other threads can access it....
Read more >Understanding Java Buffer Pool Memory Space - FusionReactor
A direct buffer is a chunk of native memory shared with Java from which you can perform a direct read. An instance of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Netty has its own memory accounting. What you see from the JMX beans is the accounting done by the JVM, but that only takes the DirectByteBuffer instances into account. In Netty, when Unsafe is available, we allocate direct memory with it, and those allocations are not counted by the JVM.
Closing this for now