tags:

views:

3552

answers:

5

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?

Thanks gurus!

+2  A: 

what platform are you running?..
if its unix, maybe adding

alias java='java -XmX1g'

to .bashrc (or similar) work

adi92
+3  A: 

For Windows users, you can add a system environment variable named _JAVA_OPTIONS, and set the heap size values there. The JVM should be able to grab the virtual machine options from _JAVA_OPTIONS.

The Dissonant
A: 

@The Dissonant

Hi Please attach the syntax used to increase java heap space through environment variables, using _JAVA_OPTIONS in WINDOWS VISTA machine

Please let me know.

+2  A: 

Apparently, _JAVA_OPTIONS works on Linux, too:

> export _JAVA_OPTIONS="-Xmx1g"
> java -jar jconsole.jar &
Picked up _JAVA_OPTIONS: -Xmx1g
Kutzi
A: 

how could increase JVM in window vista machine?

eep822