Where do these java native memory allocated from?

后端 未结 1 1664
广开言路
广开言路 2020-12-10 06:38

JDK version is hotspot 8u_45

I researched native memory of my java process. The native memory even consumes more space than heap. However there are many native memor

相关标签:
1条回答
  • 2020-12-10 07:00

    Use jemalloc or tcmalloc - they both have built-in allocation profiler that will help to identify the source of allocations.

    Java process may use too much native memory for many reasons. Popular reasons are

    • Direct ByteBuffers
    • Memory allocated by Unsafe.allocateMemory
    • Unclosed resources (e.g. ZipInputStream)
    • other native libraries

    Note that NativeMemoryTracking will not show memory consumed by native libraries.

    0 讨论(0)
提交回复
热议问题