I am not an expert with Java´s configuration, and I have a situation that I don´t understand. First of all, I am working at Centos 6.2 with jdk_1.6 and Tomcat 7.
The problem is...
- If I run Tomcat with JAVA_OPTS="-Xmx128m"* (at catalina.sh) all works fine.
- If I run Tomcat with JAVA_OPTS="-Xmx512m"* (at catalina.sh) an error appears:
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
This appear when I run java -version or when I try to stop Tomcat, and the Tomcat isn´t able to stop.
The strange thing is that my server has more than 200M free in physical memory. So, why Tomcat isn´t able to stop? and Why Java doesn´t use the free memory in my server?
Thanks in advanced.
Hello EJP, thanks for your answer.
I have explained bad.
The server has 703M free when Tomcat is stopped. I had mentioned that my server has more than 200M free in physical memory when Tomcat is running with JAVA_OPTS="-Xmx512m", so I don´t understand why these errors appear.
Do you understand me?
Recently I have checked the swap memory, and it is disabled. In spite of swap memory is disabled I think java wouldn´t need this memory because it has free physical memory
You are probably running this on a 32 bit environment. The JVM requires contiguous blocks of memory when allocating it for the mx parameter, so even if you had 1GB of free memory but it is fragmented with no fragments big enough, then you will still have the same problem.