Make -Xmx a default java option?
Posted on 2006-06-25
I am running java on a virtual Linux server which limits the memory usage to just under 1GB. I've just installed the JDK 1.5, and when I run "java -version" I get:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
I've done some troubleshooting and have determined that Java is using the "-server" option as the default ("java -help" says so). I'm guessing that with the server version, the default memory usage is 1GB, because I can make Java work either by using "-client" or by specifying a smaller amount of memory (e.g. -Xmx512M). I can also reproduce the error above by using "-Xmx1024M"
Now for my question: is there an environment variable or property file that Java checks for default options? I'd like make the "java" command work by default by making java use "-Xmx512" by default.
Thanks in advance!