increase the java heap size permanently?

rufus picture rufus · May 19, 2009 · Viewed 98.9k times · Source

Is there a way that I can set the default heap size for the jvm on my own computer? I want to set it to 1g, because I'm always running custom programs that always hit the overage point in the default jvm size.

I just dont want to have to remember to type -XmX1g everytime I run my java app from the command line...

There has to be an admin way to do this right?

Answer

Kutzi picture Kutzi · Oct 2, 2009

Apparently, _JAVA_OPTIONS works on Linux, too:

$ export _JAVA_OPTIONS="-Xmx1g"
$ java -jar jconsole.jar &
Picked up _JAVA_OPTIONS: -Xmx1g