A java application I'm using keeps crashing, when I had a problem with a similar application I managed to fix it by allocating more of my RAM to Java. How do I do that?

(I recently upgraded to 16 GB RAM, after installing Java.)

I'm on an iMac running Mac OSX 10.6.6.

link|improve this question

36% accept rate
feedback

1 Answer

java -Xmx1024M -Xms1024M -jar *filename*.jar

Xmx is the max amount you want to allocate (in MB) and the Xms is the initial amount. You can replace the 1024 with the amount you prefer.

link|improve this answer
can i change it to permanently increase the RAM given to java whenever i run call a .jar file? – Kirstin Apr 12 '11 at 7:53
@Bec, no, you can't do this across the board to any .jar. – jzd Apr 12 '11 at 11:01
@Bec The only way I could think that you could do that is IDE specific. I use NetBeans and I know you can edit NetBean's config file and tell it to use more RAM. I assume you could do the same with other IDE's. But as for setting a specific amount using the command line, I believe jzd is correct. – Ryan Apr 12 '11 at 17:10
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.