• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting heap space in Eclipse?  RSS feed

 
David Galea
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I was wondering how one can change the default Heap Size when building Java Programs in Eclipse?

My first thought was to change the Run Config, i.e. Run --> Run Configurations --> Arguments
and typing -vmargs -Xmx256M, but it doesn't seem to work.

is there any easy way to do this (I'm a bit of a Java/Eclipse noob)? and is 256M the max heap size?

Thanks in Advance,

David
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, and welcome to JavaRanch!
you should navigate to Windows - Preferences - Java - Installed JREs, then select the JRE you'll be using and hit the Edit... button. In the Default VM arguments text box you can set the heap space options and any other supported options. Note that these options only apply to JVMs started by Eclipse using that specific JRE. If you want to change the settings for Eclipse itself you should edit the eclipse.ini file in the Eclipse root directory.
As for your second question, no 256M is not the maximum heap space you can allocate to a JVM instance. It depends on the amount of physical memory installed and whether it is a 32-bit or 64-bit JVM.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!