为什么java进程中的线程数与非堆内存的实际大小不同?
由于我缺乏英语知识,这些句子可能很奇怪 感谢所有阅读该问题的人。
你好?
我在Centos7上运行一个java进程并使用jconsole对其进行监控,但是当前创建的线程数在非堆内存大小上是不同的。
我知道一个线程默认占用1mb,但是即使创建100个线程,非堆内存的大小也不是100mb。为什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
非堆内存,如
jconsole
所示,包括元空间、压缩类空间和代码缓存。换句话说,它计算加载的类和编译的方法使用的内存。它与线程和堆栈无关。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.