LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1135|回复: 3

各种java vm 支持的thread数目

[复制链接]
发表于 2005-10-25 08:24:37 | 显示全部楼层 |阅读模式
sun jre 1.5 缺省参数运行大约5500左右报outofmemory
gij 4.0 大约378左右,无论怎么调大heap size
sable-vm与gij差不多375左右
kaffe 缺省参数7500左右。

是不是gij与sable-vm的实现有点问题?

debian etch 512M RAM - 32M shared video memory
 楼主| 发表于 2005-10-25 15:46:58 | 显示全部楼层
  1. public class Test {
  2. public static void main(String[] args){
  3.         Runnable run = new Runnable(){
  4.                 public void run(){
  5.                         try{
  6.                             Thread.sleep(Integer.MAX_VALUE);
  7.                             System.err.println("Wait End");
  8.                         }catch(InterruptedException e){
  9.                             System.err.println("Thread interrupted");
  10.                         }
  11.                 }
  12.         };

  13.         for(int i=0; i<10000; i++){
  14.                 Thread th = new Thread(run);
  15.                 th.start();
  16.                 System.out.println("Start thread "+i);
  17.         }
  18.         try{
  19.                 Thread.sleep(Integer.MAX_VALUE);
  20.         }catch(InterruptedException e){}
  21. }
  22. }
复制代码
回复 支持 反对

使用道具 举报

发表于 2005-11-7 01:06:14 | 显示全部楼层
是你的内存不够。我这里都到了 32410 才停。(fork到顶了)

java -Xms1024M -Xmx1024M -xss1024k Test

试试
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-11-8 16:31:05 | 显示全部楼层
在我的480M机器上没有效果。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表