tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "STOCKHOLM, Raymond" <R.STOCKH...@aubay.lu>
Subject RE: JVM memory allocation
Date Thu, 01 Apr 2004 08:08:59 GMT
If tomcat is installed as a service you MUST set the parameters for CATALINA in the service
:
CATALINA_OPTS=-server -Xms300m -Xmx300m -XX:NewRatio=2 -Xconcurrentio

Try a script such as this one (change whatever you need : java_home, catalina_home...) 
to  install your service.
This script is for tomcat 4.1.*, but I guess it should work for 5.0.*
With thus script, you should see 9 JVM options (0 to 8)

set JAVA_HOME=C:\j2sdk1.4.1_05

set CATALINA_HOME=G:\TOMCAT4.1.18

set CATALINA_OPTS=-server -Xms300m -Xmx300m -XX:NewRatio=2 -Xconcurrentio

set PARAMETERS=%JAVA_HOME%\jre\bin\server\jvm.dll 
set PARAMETERS=%PARAMETERS% -Djava.class.path=%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar
set PARAMETERS=%PARAMETERS% -Dcatalina.home=%CATALINA_HOME%
set PARAMETERS=%PARAMETERS% -Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed
set PARAMETERS=%PARAMETERS% -Dsun.io.useCanonCaches=false
set PARAMETERS=%PARAMETERS% %CATALINA_OPTS%
set PARAMETERS=%PARAMETERS% -start org.apache.catalina.startup.Bootstrap -params start
set PARAMETERS=%PARAMETERS% -stop org.apache.catalina.startup.Bootstrap -params stop
set PARAMETERS=%PARAMETERS% -out %CATALINA_HOME%\logs\stdout.log
set PARAMETERS=%PARAMETERS% -err %CATALINA_HOME%\logs\stderr.log

%CATALINA_HOME%\bin\tomcat -install "Apache Tomcat 4.1" %PARAMETERS%

-----Message d'origine-----
De : Li Li [mailto:lili@moreatonce.com]
Envoyé : jeudi 1 avril 2004 09:59
À : tomcat-user@jakarta.apache.org
Objet : JVM memory allocation


Hi All,

I have some problems with my server.
I'm using Tomcat 5.0.18 with IIS 5.0 with isapi_redirector2.dll, J2SDK 1.4.2.
My server is running on Windows 2000 Server.
It has 2 processors and 2GB of memory.

My server, crashes very frequently.
At that time, Tomcat and IIS service is still running,  and the memory usage is around 20%,
but the CPU usage consistently remain at 50% for about 1min, the browser will returned "Page
Not Found" error when trying to access. Then I must restart my server. I even cannot just
restart the "Apache Tomcat" and "W3svc" service, since one of them cannot be stopped. Can
somebody figure out for me what caused this?


My JVM max Memory allocation for this server is about 128 MB, total memory is about 64M, sometime
the free memory drop to 20K. I try to allocate more memory to JVM. I try to set it in system
variable, in catalina.bat (set JAVA_OPTS=-Xms256 -Xmx512), and in workers2.properties, and
even in Registry. But non of them work for me. Can anybody tell me how to increase the memory
for JVM.

Actually, after I install Tomcat 5.0.18 as Service, it has written one record to Registry
under "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tomcat5", but just have two items,
"Enum and Security", so I add one item "Parameters", which includes "JVM Library", "JVM Option
Count", "JVM Option Number 0 ~ 4", ... So I can set "-Xms256M", and "-Xmx256M". But it doesn't
work either, the total memory for JVM is still around 64M.

Another thing is the default name under "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\"
is "Tomcat5", which is inconsistant with the name in Service Monitor - "Apache Tomcat". Is
this correct? And the CATALINA_HOME is "c:\Tomcat 5.0", which has a space inside. Does this
will affect the result?


Regards,


Li Li





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.616 / Virus Database: 395 - Release Date: 3/10/2004

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message