简体   繁体   中英

Error occurred during initialization of VM; Could not reserve enough space for object heap; Could not create the Java virtual machine

I got this java problem

[root@peach sbin]# java
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
[root@peach sbin]# free -m
             total       used       free     shared    buffers     cached
Mem:           256        182         73          0          0          0
-/+ buffers/cache:        182         73
Swap:            0          0          0
[root@peach sbin]# 

This is a virtual machine. I am thinking this problem because of the memory is not big enough. If some one agree with me.

It is running with a CentOS release 5.6 (Final)

Thanks

Try

java -Xmx64m

Basically your machine doesn't have enough memory, but you may be able to get away with 64MB. Let me know how you get on.

You can use this command to know your current memory usage:

swapinfo -tam

I had the same error and the memory use was above 95%.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM