Eclipse and Java heap space (plus .dll)!!!

I got this problem "java.lang.OutOfMemoryError: Java heap space" a lot and search a lot these days, just because there are recursive calls in my program. Many people have suggested the options:

 

1, change file "eclipse.ini" for the values of this part "-Xms40m-Xmx256m";

 

2, command line input: "eclipse -vmargs-Xms256m-Xmx50g".

 

(See how much memory I specified? 50g!)

 

I once thought they worked, especially the second one. I just realized that the second one did not, because eclipse never complains, even if I set 50g for the heap size (while my slow machine only has poor 2g memory). I remember that some lab machines do say that it cannot create JVM because the heap size I specified is too big when I use command line setting. Maybe that is the version problem. The eclipse in my machine is 3.2 while the  lab one is latest (), which you do can set the size in command line.

 

I switch to the setting in the Run configuration window of the program I want to run (The second text field special for "VM arguments "). It worked, and complained when I set even over 1208m, considering my physical memory is just 2g. It seems really to be the place to specify the heap size of JVM for the program that you are running, instead of every program in eclipse. And I think it is better to specify it here instead of setting the whole eclipse or the "default" JVM for your whole system.

 

=====================================

 

I got another problem for a ".dll" used in eclipse. Mostly when writing Java program, I just import the ".jar" package. But there is an old program that uses a ".dll" and when I imported the whole program as a projuect, there are some reference error. I did not know where to specify the position of this ".dll" file until I googled.

 

In the "Java Build Path"--"Libraries", click the ".jar" file you added before. There is a Native library location . That is the place to enter the location of the ".dll" file, with such a prompty "Enter the location of a folder containning the native libraries used by 'xxx.jar':"!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值