This tutorial explains how you can fix Java virtual machine creation errors on Windows.
Every now and then I like to play a relaxing computer game, and the excellent strategy game TripleA was my game of choice yesterday. It is a Java-based game but since the machine I wanted to run it on had Java (only untied from the browser) , I did not think that this would be an issue.
When I tried to start the game though after installation it quit immediately afterwards. The error message that it displayed was definitely Java related:
Error: Could not create the Java Virtual Machine
Error: A fatal exception has occurred. Program will exit.
First thing I did was double-check to make sure that Java was indeed properly installed - it was. It was the most recent version and the game should just run fine using it according to the game's website.
After some digging around and testing I came up with a solution for the issue that worked and resolved the error message so that the Java application started just fine. It involves changing how much memory Java is allowed to use on the system.
Java on Windows uses an initial size of 16 Megabyte and a maximum of 64 Megabyte. You can find that out by yourself by running the command java -XX:+PrintFlagsFinal -version on your machine. Check the InitialHeapSize and MaxHeapSize values here (displayed in Bytes).
Now, to resolve the error message we need to increase the size that Java can use for memory. Here is how that is done (demonstrated using Windows 7, may differ slightly on other versions of Windows):
The setting is available right away, you do not need to restart the computer first. It raises the allowed memory to 256 Megabyte. If your application does not run fine afterwards, try raising the memory to 512 or even 1024 Megabyte instead.
Note that this increases the maximum heap size only. If you also need to increase the minimum heap size, use -Xms256M for that.Advertisement
Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.
We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.
If you like our content, and would like to help, please consider making a contribution:
Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.