Op maandag, 31 mei 2010 17:40 schreef John Mok <[email protected]>:>
Hi,
I am running Tomcat 4.1.30 on Ubuntu Linux 8.04.4 LTS. After moving the
application from a 32-bit machine to a 64-bit machine with 4GB memory, suddenly
tomcat failed to startup with the following error :-
>Stopping service Tomcat-Standalone
>May 29, 2010 4:27:36 PM org.apache.coyote.http11.Http11Protocol destroy
>INFO: Stoping http11 protocol on 8080 >Catalina:type=ThreadPool,name=http8080
>Error occurred during initialization of VM
>java.lang.OutOfMemoryError: unable to create new native thread
On the 64-bit machine, I used the following software :-
Ubuntu 8.04.4 LTS for amd64
Sun JDK 1.5.22 (amd64)
export JAVA_HOME=/opt/jdk1.5.0_22
export PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/bin:$PATH
export CLASSPATH=.
export CATALINA_OPTS="-Djava.awt.headless=true -d64 -Xss3072m -Xmx3072m
-XX:PermSize=256m -XX:MaxPermSize=256m"
When I reduced the max memory to 1GB, tomcat started without any problem :-
export CATALINA_OPTS="-Djava.awt.headless=true -d64 -Xss1024m -Xmx1024m
-XX:PermSize=256m -XX:MaxPermSize=256m"
Don't you really want -Xms in stead of -Xss? Setting the stack size to 3 GB is
quite unusual. Every thread gets a stack of this size, so 10 threads already
need 30 GB of memory.
# java -X
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
Ronald.