Solution for "Could not create the Java Virtual Machine"

The problem: we wanted to give more memory to Blast2GO running on Windows 7 x64, but we kept getting the error *beep* "Could not create the Java Virtual Machine".

Looking at the makeJnlp.php file that the Blast2GO website gives you, I noticed the max-heap-size line:

<jnlp spec="1.0+" codebase="http://bioinfo.cipf.es/blast2go/webstart" href="http://bioinfo.cipf.es/blast2go/webstart/makeJnlp.php?mem=2048">
<information>
<title>Blast2GO 2048M</title>
<vendor>CIPF - UPV - IVIA</vendor>
<homepage href="http://www.blast2go.org"/>
<description>Blast2GO 2048M</description>
<description kind="short">Blast2GO 2048M</description>
<icon href="splash.gif"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.5+" initial-heap-size="64m" max-heap-size="2048M"/>
...

When I removed the max-heap-size assignment the JNLP file started just fine with Java Web Start (javaws.exe). Conclusion: somehow the machine could not actually allocate the amount of heap space we were asking for.

Sure enough, further investigation showed that the 32-bit version of Java had been installed instead of the 64-bit version.

After installing the 64-bit version and running the JNLP file with 64-bit javaws.exe, everything was fine.

Comments

Hi,
I have the same problem, but my JVM is 64 bit. As soon as I increase heap size from 1024M to 2048M I get "could not create Java Virtual Machine". Any other ideas?

Where do I go to change the Heap Size.

Unrecognized VM option '+HeapDumpOnOutOfMemoryError'
Could not create the Java virtual machine.
errorlevel=1
Press any key to continue . . .

Thanks a bunch Len, this helped me out a bunch. I wish there was a bit more information in the warning message. I changed my heap size down to 512M from 1024M and things worked just fine.

Good man. Saved me.

Hi, I also keep getting the "Could not create the Java Virtual Machine" ...... How do I change my heap size down to 512M from 1024M to see if this makes it work?

This might seem like a dumb question, but where can you change the heap size?

I tried changing -XX:MaxPermSize=1024m to -XX:MaxPermSize=768m, and it works.. I'm using eclipse for development, you may see the settings in the .ini file inside the eclipse folder (if you're using eclipse).

In my case the jbdevstudio.ini (located in the jboss developer studio install directory) file has the entry -1024m. I changed it to -XX:MaxPermSize=1024m and it works.

I have the same prob. but only im running windows XP Home in 32bit. i have deleted everything relating t Java that you can think of restarted my PC reinstalled Java onto my PC. I have the latest java w/all updates 6-23 w/RTE 6-1....
With my prob though it's with me running my MP3 Rocket
i have contacted MP3 and followed their advice and have figured out thats its the java thats not working.Everytime i try to start my MP3 i get the error message [Could not create the java virtue Machine].
Any help would be greatly appreciated.

In a nutshell, the instructions show you how to make a System Variable for Java called _JAVA_OPTIONS with the value Xmx512M. This sets a global maximum heap memory size for Java. You can solve this by:

Open the Control Panel
Go to System
Go to Advanced Systems Properties
Then Environment Variables
In System Variables, click Add
New Variable Name: _JAVA_OPTIONS
New Variable Value: -Xmx512M
Click OK

That's it, your Java program should now be able to execute properly.
For those interested, Java -Xmx/s is the configuration parameter that control the amount of memory Java uses.

Xmx sets the maximum heap memory size
Xms sets the minimum heap memory size

http://net-informations.com/java/intro/jvm.htm