user3066803
user3066803

Reputation: 11

Java "Error occurred during initialization of VM" fix?

I was trying to make a Minecraft server and got the following error on startup:

Error occured during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine Error: A fatal exception has occurred. Program will exit.

I tried everything I could find: I created CLASS and CLASSPATH environmental variables that went to my Java's bin folder. I re-installed java, making sure it was 64 bit, as my computer is. Still, I get this error. Does anyone know a solution?

Upvotes: 0

Views: 89892

Answers (8)

Dipesh Majithia
Dipesh Majithia

Reputation: 91

My issue was resolved after I reinstalled latest version of JDK.

Upvotes: 1

WeJava
WeJava

Reputation: 31

It happened to me also. My eclipse would not run. Uninstalled and reinstalled eclipse like 3 time and no luck. Came to this question during a google search, and Yasir's answer helped me out, because I also had IntelliJ installed into my DEV BOX recently. So deleted C:\Program Files\Java folder and reinstalled java into default install folder and it worked. I also had jdk in my system path from previous setup.

Upvotes: 0

Yasir Shabbir Choudhary
Yasir Shabbir Choudhary

Reputation: 2578

I also faced this issue by My IntellijIDEA allocate more jvm memory space than system allocated. My issued is resolved through just uninstall the JDK and install it again.

Upvotes: 0

Jitendra
Jitendra

Reputation: 846

I encountered this error when I was trying to build selenium webdriver. as suggested above by Rogue that we need to reduce the allocated memory in the arguments.

I changed java heap size arguments as below

java $JAVA_OPTS -Xmx256m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=256m -jar third_party/jruby/jruby-complete.jar -X-C -S rake $*

Upvotes: 0

Erik
Erik

Reputation: 117

I had this same error. Running the cmd as Administrator resolved it.

Upvotes: 0

user3608737
user3608737

Reputation: 1

I've actually noticed this issue when you try and take a dump of a service running java. Try using psexec -s to execute your dump

I'm not sure why this seems to work on some servers and not others

Upvotes: 0

Melih Altıntaş
Melih Altıntaş

Reputation: 2535

Run the JVM with -XX:MaxHeapSize=256m (or any big number), and possibly -Xmx512m

Upvotes: 0

Rogue
Rogue

Reputation: 11483

You are attempting to allocate more RAM than your system will allow you to allocate.

In your startup script, lower the values of your Xmx/Xms arguments.

Upvotes: 4

Related Questions