本站首页    管理页面    写新日志    退出


«August 2025»
12
3456789
10111213141516
17181920212223
24252627282930
31


公告

戒除浮躁,读好书,交益友


我的分类(专题)

日志更新

最新评论

留言板

链接

Blog信息
blog名称:邢红瑞的blog
日志总数:523
评论数量:1142
留言数量:0
访问次数:9689547
建立时间:2004年12月20日




[jvm]JVM - Could not reserve enough space for object heap的解决
原创空间,  文章收藏

邢红瑞 发表于 2010/1/26 17:02:38

程序启动时,出现Error occurred during initialization of VMCould not reserve enough space for object heapCould not create the Java virtual machine.以前在solaris遇到过swap空间不够,#mkfile 500m /opt/myswap#swap -a /opt/myswap讲/opt/myswap加入/etc/vfstablinux上32-bit JVM 只能访问2G的内存空间,减少-mmx的值就行了,如果在windows上使用jrockit,可以使用3G空间,public class MemLoadTester {        public static void main ( String[] args ) {             long rand;            char cr;            char[] cra = new char[2048];             for ( int i=0; i<2048; i++) {                rand = 70 + Math.round( Math.random() * 50);                cr = (char) rand;                cra[i] = cr;            }             int entities = 800000;            int blocksize = 10240;             String[] zz = new String[ entities];             // Java char type is 2bytes.            System.out.println (" Each box indicates the creation of ~40Meg");             for ( int j=0; j<entities; j++ ) {                zz[j] = new String( cra );                if (j != 0 && j % blocksize == 0 ) {                    System.out.print ( "#" );                }                 if (j != 0 && j % (blocksize * 10) == 0 ) {                    System.out.println ( "" );                 }             }             System.out.println( "\n");         }    System.out.println ( " Success ");}


阅读全文(7617) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.047 second(s), page refreshed 144754722 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号