You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Roel De Nijs <ro...@aquafin.be> on 2006/02/02 10:57:20 UTC

Memory Management between different webapps

Hi,
 
I have a tomcat with ± 10 web-applications. Is there a maximum or some guidance in the number of web-apps you can put in one instance of Tomcat?
 
And i start tomcat with the options -Xmx1024m -Xms1024m --> is there some information or articles about how tomcat is spreading all this memory over the web-apps? Is this completely random, or first come first gets? What if a web-app is called for the first time and all possible memory is allocated to other web-apps?
 
Many thanks already
Roel


**************************************************************
Disclaimer: zie www.aquafin.be

Re: Catalina.out gets to big-> Server crashes

Posted by Boris Unckel <bo...@gmx.net>.
> sorry, I just clean forgot to tell the version its 5.5.9.
> 
> I discovered the tomcat-juli.jar in the bin directory 
> so I suppose its in use. Although I never used it so far.
> 
> So the idea is to switch x4juli.jar and I get the same functionality
> as in log4J? That's great because I'm using it to log my webapps.
What are you using in your webapps? java.util.logging or log4j?
If you are using java.util.logging in your webapps try x4juli.
If you are using log4j in your webapps try log4j with 
http://tomcat.apache.org/tomcat-5.5-doc/logging.html
http://tomcat.apache.org/faq/logging.html
> 
> So despite this option the only real solution would be to do
> it with shell scripts in my linux environment?
This is a bad option. You would move an open file (during Tomcat run) to an
separate name/directory.

Regards
Boris

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


RE: Catalina.out gets to big-> Server crashes

Posted by Tim Lucia <ti...@yahoo.com>.
Which are you using?  Log4j already has a RollingFileAppender (size or date
based, your choice) which rolls logs automatically.  Or, you can use
logrotate on linux.

http://logging.apache.org/log4j/docs/api/org/apache/log4j/DailyRollingFileAp
pender.html
http://logging.apache.org/log4j/docs/api/org/apache/log4j/RollingFileAppende
r.html

Tim

-----Original Message-----
From: Peter.Neu@gmx.net [mailto:Peter.Neu@gmx.net] 
Sent: Thursday, February 02, 2006 5:32 AM
To: Tomcat Users List
Subject: Re: Catalina.out gets to big-> Server crashes


Hello,

sorry, I just clean forgot to tell the version its 5.5.9.

I discovered the tomcat-juli.jar in the bin directory 
so I suppose its in use. Although I never used it so far.

So the idea is to switch x4juli.jar and I get the same functionality as in
log4J? That's great because I'm using it to log my webapps.

So despite this option the only real solution would be to do
it with shell scripts in my linux environment?

cheers,
Pete


> --- Ursprüngliche Nachricht ---
> Von: "Boris Unckel" <bo...@gmx.net>
> An: "Tomcat Users List" <us...@tomcat.apache.org>
> Betreff: Re: Catalina.out gets to big-> Server crashes
> Datum: Thu, 2 Feb 2006 11:20:08 +0100 (MET)
> 
> Good Morning,
> 
> > Does anyone know how configure tomcat so that catalina.out only get 
> > a
> size
> > of 100 MB and then replaces it by a new empty catalina.out? The old 
> > one should be saved under a different name.
> > 
> There is information missing:
> Which Tomcat Version?
> Which logging API is in use?
> 
> Assuming Tomcat 5.5.x with default installation and Tomcat JULI in 
> use: Change to x4juli (see http://www.x4juli.org and the samples in 
> the distribution for Tomcat) and use a RollingFileHandler.
> 
> Without changing to x4juli (or log4j):
> Reduce the log level in conf/logging.properties for the FileHandler to 
> WARNING or SEVERE. You still have the problem that there is no rolling 
> but the log amount is reduced.
> 
> Regards
> Boris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

-- 
DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert:
GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl

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



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


Re: Catalina.out gets to big-> Server crashes

Posted by Pe...@gmx.net.
Hello,

sorry, I just clean forgot to tell the version its 5.5.9.

I discovered the tomcat-juli.jar in the bin directory 
so I suppose its in use. Although I never used it so far.

So the idea is to switch x4juli.jar and I get the same functionality
as in log4J? That's great because I'm using it to log my webapps.

So despite this option the only real solution would be to do
it with shell scripts in my linux environment?

cheers,
Pete


> --- Ursprüngliche Nachricht ---
> Von: "Boris Unckel" <bo...@gmx.net>
> An: "Tomcat Users List" <us...@tomcat.apache.org>
> Betreff: Re: Catalina.out gets to big-> Server crashes
> Datum: Thu, 2 Feb 2006 11:20:08 +0100 (MET)
> 
> Good Morning,
> 
> > Does anyone know how configure tomcat so that catalina.out only get a
> size
> > of 100 MB and then replaces it by a new empty catalina.out? The old one
> > should be saved under a different name. 
> > 
> There is information missing:
> Which Tomcat Version?
> Which logging API is in use?
> 
> Assuming Tomcat 5.5.x with default installation and Tomcat JULI in use:
> Change to x4juli (see http://www.x4juli.org and the samples in the
> distribution for Tomcat) and use a RollingFileHandler.
> 
> Without changing to x4juli (or log4j):
> Reduce the log level in conf/logging.properties for the FileHandler to
> WARNING or SEVERE. You still have the problem that there is no rolling but
> the log amount is reduced.
> 
> Regards
> Boris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

-- 
DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert:
GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl

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


Re: Catalina.out gets to big-> Server crashes

Posted by Boris Unckel <bo...@gmx.net>.
Good Morning,

> Does anyone know how configure tomcat so that catalina.out only get a size
> of 100 MB and then replaces it by a new empty catalina.out? The old one
> should be saved under a different name. 
> 
There is information missing:
Which Tomcat Version?
Which logging API is in use?

Assuming Tomcat 5.5.x with default installation and Tomcat JULI in use:
Change to x4juli (see http://www.x4juli.org and the samples in the
distribution for Tomcat) and use a RollingFileHandler.

Without changing to x4juli (or log4j):
Reduce the log level in conf/logging.properties for the FileHandler to
WARNING or SEVERE. You still have the problem that there is no rolling but
the log amount is reduced.

Regards
Boris

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


Re: Catalina.out gets to big-> Server crashes

Posted by Tim Funk <fu...@joedog.org>.
http://tomcat.apache.org/faq/logging.html#catalina.out

-Tim

Joost de Heer wrote:
>>now the question I have is now, how can I here setup jsvc so that it
>>uses logrotation,
> 
> 
> As far as I'm aware catalina.out can't be rotated. For the Tomcat servers
> I maintain I've written a script that stops/moves catalina.out/gzips
> catalina.out/starts Tomcat every Sunday night at 4am. Not the most elegant
> solution but it works.


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


Re: Catalina.out gets to big-> Server crashes

Posted by Joost de Heer <sa...@xs4all.nl>.
> now the question I have is now, how can I here setup jsvc so that it
> uses logrotation,

As far as I'm aware catalina.out can't be rotated. For the Tomcat servers
I maintain I've written a script that stops/moves catalina.out/gzips
catalina.out/starts Tomcat every Sunday night at 4am. Not the most elegant
solution but it works.

Joost


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


Re: Catalina.out gets to big-> Server crashes

Posted by Christian Andersson <ca...@ofs.no>.
I recently came across this problem also (i've read some of the later 
mails in this discussion also and I'm answering to those too) with a 
tomcat 5.5.12 installation and using the ext3 filesystem.

anyway, my setup is using jsvc from the commons daemon project, and the 
catalina.out file is defined in the startup script I'm using for jsvc.. 
and that part looks like this... (this is btw from my developer server 
so ignore the fact that it is not logging to /var/log/...)

     $CATALINA_HOME/bin/jsvc \
     -user $TOMCAT_USER \
     -home $JAVA_HOME \
     -pidfile /var/run/jsvc-tomcat.pid \
     -Dcatalina.home=$CATALINA_HOME \
     -Djava.io.tmpdir=$TMP_DIR \
     -outfile $CATALINA_HOME/logs/catalina.out \
     -errfile '&1' \
     $CATALINA_OPTS \
     -cp $CLASSPATH \
     org.apache.catalina.startup.Bootstrap

here the parameter -outfile is beeing used to tel where the catalina.out 
file is..

now the question I have is now, how can I here setup jsvc so that it 
uses logrotation, I've searched the net 8google, commons daemon) but not 
been able to get a satisfying answer, but perheps the commons-daemon 
folk in their mailing list knows more and I have to ask there...

/Christian Andersson



Peter.Neu@gmx.net wrote:
> Hello,
> 
> I got this problem that the catalina.out file gets to big. It grows to
> a size of approx. 2 gig and then tomcat just crashes. 
> 
> Does anyone know how configure tomcat so that catalina.out only get a size
> of 100 MB and then replaces it by a new empty catalina.out? The old one
> should be saved under a different name. 
> 
> cheers,
> Pete 
> 

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


Catalina.out gets to big-> Server crashes

Posted by Pe...@gmx.net.
Hello,

I got this problem that the catalina.out file gets to big. It grows to
a size of approx. 2 gig and then tomcat just crashes. 

Does anyone know how configure tomcat so that catalina.out only get a size
of 100 MB and then replaces it by a new empty catalina.out? The old one
should be saved under a different name. 

cheers,
Pete 

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen f�r GMX Partner: http://www.gmx.net/de/go/partner

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