File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Increase JVM heap size of eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Increase JVM heap size of eclipse" Watch "Increase JVM heap size of eclipse" New topic

Increase JVM heap size of eclipse

dila peerbux

Joined: Dec 30, 2007
Posts: 5
Can anyone please tell me on how i can increase the heap size of eclipse?when running a program i am getting the error as follows:

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

Thank you in advance!!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15082

Use the -Xmx command line switch. Specifically for Eclipse, do this:

eclipse.exe -vmargs -Xmx512M

This gives Eclipse a maximum of 512 MB memory.

Note: I am assuming you want to give the Eclipse IDE itself more memory. If this isn't an issue with the IDE itself but with your own program which you are launching from the IDE, then you'll need to do something different: Select Run / Open Run Dialog, then select the configuration for launching your application. Click the Arguments tab, and in the box "VM arguments" add something like "-Xmx256M" to give your application 256 MB of memory.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: Increase JVM heap size of eclipse
It's not a secret anymore!