What is contained in code/internal sections of JCMD?

后端 未结 1 1928
忘了有多久
忘了有多久 2021-01-02 14:24

Dimensioning a docker container for a JVM based service is tricky (as we all know). I\'m pretty sure we have slightly under-dimensioned a container and want to clear up a fe

相关标签:
1条回答
  • 2021-01-02 14:51

    Are Direct Byte Buffers included in "Internal" as reported by jcmd?

    (updated) ByteBuffer.allocateDirect internally calls Unsafe.allocateMemory which is counted by NMT in the Internal section (denoted by mtInternal constant).

    On the contrary, MappedByteBuffers (obtained by FileChannel.map) are not reflected in NMT report, though they definitely may affect the amount of memory used by the process from OS perspective.

    What else apart from code cache is in "Code" as reported by jcmd?

    Auxiliary VM structures for maintaining compiled code and generated runtime stubs: hashtables, code strings, adapter fingerprints etc. They all are rather small comparing to the CodeCache itself. These structures make up 'malloc' part in the report while the CodeCache goes into 'mmap' part.

    Is there a good way to limit the "Code" section as reported by jcmd.

    Turning off tiered compilation (-XX:-TieredCompilation) is likely to reduce the amount of memory used by "Code", just because there will be a lot less generated code. But make sure you understand what tiered compilation is and what performance impact it may have.

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