This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Increase JVM heap size of eclipse

 
dila peerbux
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15438
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic