线程在Java中占用多少内存 [英] how much memory a thread takes in java

查看:888
本文介绍了线程在Java中占用多少内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

普通线程占用Java多少内存.假设没有与之关联的对象.

How much memory foot print does a normal thread takes in java. Assuming that there is no object associated with it.

推荐答案

为线程堆栈分配的内存量特定于您的JVM版本+操作系统.它使用-XX:ThreadStackSize选项配置(在旧版本上为-Xss.)有趣的是512KB是正常"的,尽管在64位linux上它是1024,这可能是最常见的平台(反正一个人的看法)

The amount of memory allocated for a thread stack is specific to your JVM Version + Operating System. It is configured with the -XX:ThreadStackSize option (-Xss on older versions.) Anecdotally 512KB is "normal", although it is 1024 on 64-bit linux which is probably the platform it's most commonly critical (one guy's opinion anyway)

这篇关于线程在Java中占用多少内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆