0

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

Community
  • 1
  • 1
murali
  • 41
  • 1
  • 5

4 Answers4

2
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

Erik
  • 88,732
  • 13
  • 198
  • 189
0

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

  • There must not be a `:` in `-Xmx:512M`. It should be `-Xmx512M` (or `-Xmx512m`) if you want to set the max. amount of memory to 512 MB. – Jesper Mar 22 '11 at 10:32
0

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.

katsharp
  • 2,551
  • 24
  • 27
0

Tune -XX:MaxPermSize also.

This parameter will also laed to java.lang.OutOfMemoryError

Nike
  • 312
  • 1
  • 2
  • 9