# Apache Tomcat problem with heap



## tmkd (Dec 23, 2009)

Welcome, i have problem while running Apache Tomcat 6.0.20 on my shell: catalina.sh run shows.

```
Using CATALINA_BASE:   /usr/home/tmkd/programs/apache-tomcat-6.0.20
Using CATALINA_HOME:   /usr/home/tmkd/programs/apache-tomcat-6.0.20
Using CATALINA_TMPDIR: /usr/home/tmkd/programs/apache-tomcat-6.0.20/temp
Using JRE_HOME:       /usr/local
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
```
I heard that in this situation i have to change heap size in CATALINA_OPT but its not work. 
Cany you help?


----------



## anomie (Dec 24, 2009)

That doesn't look like a real JRE_HOME. What does `% locate java` tell you?


----------



## tmkd (Dec 24, 2009)

Unfortunately i have not access to locate. Do you think that problem is only in wrong JRE_HOME?


----------



## sixtydoses (Dec 24, 2009)

Your JRE_HOME should point to a JDK install path. If you leave it empty, it'll point to JAVA_HOME. Try to `echo $JAVA_HOME` and see if it points to the correct path.


----------



## tmkd (Dec 24, 2009)

JDK is installed properly. Problem is not in JAVA_HOME or JRE_HOME. On this shell i have 1GB disk space, and i dont know how much ram. I try to set in CATALINA_OPTS some parameters which decrease memory but it now works.


----------



## tmkd (Dec 24, 2009)

I have add -Xmx128M(without -Xms128M) to CATALINA_OPTS and Tomcat almost always starts.


----------



## tmkd (Dec 25, 2009)

Sorry, i add -Xmx64. And I dont know why it works.


----------

