1

I'm writing a java program using the Eclipse IDE (Kepler Service Release 1) that is causing the JVM to hog more memory than it needs. I don't run out of RAM but the fan really ramps up. I'd like to experiment with limiting the JVM's seemingly godlike power over system memory.

Apparently there is a way to start the JVM with a switch that will limit the amount of RAM it will allow the program to consume. I know there is a setting for this in the Eclipse.ini file but that is for the IDE itself. What I want to do is limit the RAM usage for the java program when I start it in dev/debug mode. Does anyone know how that might be accomplished?

eric_the_animal
  • 432
  • 9
  • 19
  • 1
    see this [answer](http://stackoverflow.com/questions/4175188/setting-memory-of-java-programs-that-runs-from-eclipse) – Sanj Apr 22 '15 at 19:43

1 Answers1

3

Set the VM arguments for a specific run configuration they can be found at

Run → Run Configurations → Arguments Tab → VM arguments

you can do something like -Xms512

Daniel Esponda
  • 1,377
  • 1
  • 9
  • 18