为什么java进程中的线程数与非堆内存的实际大小不同?

发布于 2025-01-11 18:42:34 字数 175 浏览 6 评论 0原文

由于我缺乏英语知识,这些句子可能很奇怪 感谢所有阅读该问题的人。

你好?

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆头 2025-01-18 18:42:34

非堆内存,如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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文