java&& Linux 线程大小

来源:互联网 发布:数据库的简单实现 编辑:程序博客网 时间:2024/06/05 16:20
java线程大小

In Java SE 6, the default on Sparc is 512k in the 32-bit VM, and 1024k in the 64-bit VM. On x86 Solaris/Linux it is 320k in the 32-bit VM and 1024k in the 64-bit VM.

On Windows, the default thread stack size is read from the binary (java.exe). As of Java SE 6, this value is 320k in the 32-bit VM and 1024k in the 64-bit VM.


Linux线程大小

 ulimit -a 其中 stack size 项也表示堆栈大小。ulimit -s  value 用来重新设置stack 大小。

一般来说 默认堆栈大小为 8388608; 堆栈最小为 16384 。 单位为字节。

堆栈最小值定义为 PTHREAD_STACK_MIN ,包含#include <limits.h>后可以通过打印其值查看。对于默认值可以通过pthread_attr_getstacksize (&attr, &stack_size); 打印stack_size来查看。

尤其在嵌入式中内存不是很大,若采用默认值的话,会导致出现问题,若内存不足,则 pthread_create 会返回 12,


http://blog.csdn.net/star62003/article/details/8913074

http://blog.csdn.net/godleading/article/details/7997630

0 0
原创粉丝点击