Take the 2-minute tour ×

I'm getting this error when I run or debug my GA/AI from MyEclipse:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

eclipse.ini looks like this:

-showsplash com.genuitec.myeclipse.product
--launcher.XXMaxPermSize 256m

MyEclipse is called like this:

"C:\Program Files\MyEclipse 6.0\eclipse\eclipse.exe" -vm "C:\Program Files\MyEclipse 6.0\jre\bin\javaw.exe"  -vmargs -Xms1448M -Xmx1448M

bumping the vm settings up from this:


has had no effect. So I'm trying to get it to dump the heap to a file, but placing these:


in the Program arguments has had no effect. How do I get something to work with more memory usage analysis? jstack, for instance, is not currently available on Windows platforms. And using SendSignal has no effect that I can see.

a screen shot

share|improve this question
try upping XXMaxPermSize as well –  Thilo May 7 '09 at 22:45
add comment

3 Answers

up vote 6 down vote accepted

There are a number of ways to get heap dumps. Here are some I've used:

  1. -XX:+HeapDumpOnOutOfMemoryError should get you dump if you hit your OOM.
  2. Connect with VisualVM (free) and use its GUI to force a heap dump
  3. Use one of the many good commercial profilers (JProfiler, YourKit, ...)
  4. Use jmap (see below) to force a dump from a running process

If you're running Java 6, jmap should work on Windows. This might be useful if you want to dump the heap and you haven't hit your OOM. Use Windows Task Manager to find the pid of your Java app, and in a console run this:

jmap -dump:format=b,file=c:\heap.bin <pid>

In addition to VisualVM, the Eclipse Memory Analyzer (also free) can help you analyze what's eating up all the space once you've got the dump.

share|improve this answer
When I Run the Main function, an application is created in VisualVM that does not have dump functionality: you can't Heap Dump, Thread Dump, there is no Heap tab, etc. –  Dave Babbitt May 12 '09 at 1:04
If -XX:+HeapDumpOnOutOfMemoryError did work, what would it look like on my system? –  Dave Babbitt May 12 '09 at 12:31
jps outputs the pid process as well –  ssedano Sep 6 '12 at 10:43
Your jmap syntax worked like a charm in Windows 7 with Java 7. Thank you! –  KomodoDave Apr 9 '13 at 4:45
add comment

-XX:+HeapDumpOnOutOfMemoryError should be put in "VM Arguments" not "Program Arguments"

share|improve this answer
add comment

You can monitor memory usages with JConsole.

The jstat also will help.

share|improve this answer
add comment

Your Answer


