Wednesday, January 30, 2013

Java Webstart: Could not create the Java Virtual Machine

Problem: Java can't allocate enough contiguous memory as specified in the JNLP.

Work around: Lower the max memory setting in the JNLP, or use a 64-bit JVM that allows for more memory availability. If you have total control over the client, close running processes.

Synopsis: Researched the hell out of this, and the problem is ridiculous. On a machine with 16G of memory, and who knows how much virtual memory on top of that, the most I can set my max memory is 900M. Otherwise I intermittently get this error when launching from my JNLP.

The problem is that Java needs contiguous memory for the JVM, and because windows throws DLLs and apps in memory all over the place, the more you have running, the harder it is to get that block of contiguous memory.

Java has no guidelines for 'max memory' settings; it's all dependent on the app, the machine, and the version of java.

Keyword tags: -Xmx, max heap size, jnlp, java, web start, Error: Could not create the Java Virtual Machine


  1. This information is really good and I want to learn more about java WebStart and I think this is the beggining

  2. Most of the time you can fix this problem by uninstalling the Java runtime and then reinstalling it all over again.

    You can also try increasing the amount of system memory allocated to the Java virtual machine by setting an environment variable.

    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 :