Search code examples
javasizeheap-memory

Error when trying to increase java heap size


For a minecraft server I'm trying to run the server with more than the standard 512MB RAM. This used to work for me but when I recently installed the server again it stopped working. I use the following command line to run the server:

java -Xms1024M -Xmx2048M -jar TekkitLite.jar 
pause

But when I run this script I get the following error:

C:\Users\...\server>java -Xms1024M -Xmx2048M -jar TekkitLite.jar

Picked up_JAVA_OPTIONS: -Xmx512M Error occured during initialization of VM Incompatible minimum and maximum heap sizes specified

It seems to me it just doesn't pick up the Xmx argument or something, and I haven't found a solution to fix it anywhere.

My system:

  • OS: Windows 7 64bit
  • Java: java7u45(64bit)
  • RAM: 8G

If anyone has a solution, that would be awesome :)


Solution

  • It looks like you have -Xmx512M set in the environment variable _JAVA_OPTIONS. Clear that and try again.

    In Windows 7, this is done like this:

    1. Right-click Computer from the Start menu and choose Properties
    2. Click Advanced system settings > Advanced tab
    3. Click on Environment Variables, find _JAVA_OPTIONS, and select it.
    4. Click Delete
    5. Click OK, and you're done!