It's not a secret anymore!*
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
Author

Increase JVM heap size of eclipse

dila peerbux
Greenhorn

Joined: Dec 30, 2007
Posts: 5
Hi,
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:

Loading...
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: 14074
    
  16

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 7 API documentation
Scala Notes - My blog about Scala
 
jQuery in Action, 2nd edition
 
subject: Increase JVM heap size of eclipse
 
Similar Threads
Analyse large heap dump file
Heap Space Error
How to increase eclipse heap size?
java.lang.OutOfMemoryError
Tomcat and Optimizeit throwing Out of memory error