Error could not create the Java virtual machine in java

Previous
Next

In this post, we will about an error: Could not create the Java virtual machine in java.
You can provide VM arguments to provide heap size for Java virtual machine.You can specify VM argument -Xms and -Xmx in form of KB,MB or GB.
For example:
Let’s say you want to specify maximum heap size as 1024 MB then you can put VM argument as -Xmx1024M.

Memory Symbol
Kilobytes (KB) k or K
Megabytes (MB) m or M
Gigabytes (GB) g or G

There can be many reasons for this error. I will try to list down the most obvious reason for this error.
You might be getting this error because of one of below reasons.

  • Heap size is larger than your computer’s physical memory. For example,
  • You might have put space between -Xmx and 4096M. For example,
  • You might have put space between -Xmx1024 and m. For example,

    If you do not provide anything after 1024, it takes by default memory into bytes.
  • -Xms might be higher than -Xmx. For example,
  • You have put -Xms1024MB -Xmx2048MB instead of -Xms1024M -Xmx2048M . For example,

You can check what kind of error you are getting and fix it with above solutions.Please comment if you find some other reason for this error.

Previous
Next

Join Our News Letter – Stay Updated

Subscribe to Awesome Java Content.




Add Comment

Join Our News Letter - Stay Updated

Subscribe to Awesome Java Content.
You can like our facebook page Java2blog