tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roel De Nijs" <roel.den...@aquafin.be>
Subject Betr.: RE: Memory Management between different webapps
Date Thu, 02 Feb 2006 10:39:48 GMT
The problem we are confronted with: all our web-apps are running fine in our test-environment,
even if workload is simulated to be very high. If we go to production environment (which is
an exact copy of the test-environment) then tomcat gives OOME, sometimes 3-4 times a day.
And it looks to be at random situations, so it's a really big mistery why in test everything
goes well and in production it crashes more then once a day.  And it's doing it for approx
4 months now, so it's time it's getting solved. 

>>> Peter.Crowther@melandra.com 2/02/2006 11:06 >>>
> From: Roel De Nijs [mailto:roel.denijs@aquafin.be] 
> 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?

Tomcat itself uses relatively little memory per-webapp (a few megabytes, depending on version).
 The major load comes from the number of simultaneous connections (and hence the size of the
thread pool) and, even more, from how the webapps are written.  You're in the best place to
evaluate these.

> 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?

It's all one big object memory, shared between all the webapps.  Roughly (there are many more
nuances than this): whenever it gets full, the garbage-collector is run.  If there's not enough
space to allocate an object after the garbage collector has run, you get an OutOfMemoryError.
 So memory will be allocated as your webapps request it (and potentially returned to the Java
VM's pool of free memory some unknown time after they stop using it); if a webapp is called
for the first time and there's not enough space to allocate the memory required for its startup,
you'll get an OOME.

To my knowledge, there is no way of partitioning memory inside a single JVM such that the
amount available to a given webapp can be restricted.

        - Peter

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




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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message