开发者

java.lang.OutOfMemoryError: how to set correct Java parameters [duplicate]

开发者_开发知识库This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to deal with “java.lang.OutOfMemoryError: Java heap space” error (64MB heap size)

Hi,

can anyone please provide setting the Java parameters from the command prompt...

I am getting the Exception in thread "main" java.lang.OutOfMemoryError: Java heap space in my program

Thanks


java -Xmx128m ...

This sets the max heap size to 128MB. See http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html

eclipse -vmargs -Xmx128m

This tells eclipse to use 128MB as heap size for launched applications. See http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/running_eclipse.htm


You can set -Xmx:512M argument to increase maximum possible memory for usage.


When launching from a command prompt try increasing the memory allowance, eg:

eclipse -vmargs -Xms128m -Xmx512m

Where 128m is the min and 512m is the max heap size.


Tune -XX:MaxPermSize also.

This parameter will also laed to java.lang.OutOfMemoryError

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜