Skip to content
Advertisement

Why is the number of threads in a java process different from the actual size of non-heap memory?

The sentences may be strange due to my lack of English knowledge Thanks to everyone who reads the question.

Hello?

I am running a java process on Centos7 and monitoring it with jconsole, but the number of threads currently created is different in non-heap memory size.

I know that one thread occupies 1mb by default, but even if 100thread is created, the size of non-heap memory is not 100mb. Why?

Advertisement

Answer

Non-Heap memory, as shown by jconsole, includes Metaspace, Compressed Class Space and Code Cache. In other words, it counts memory used by loaded classes and compiled methods. It has nothing to do with threads and stacks.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement