tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Release of memory
Date Thu, 02 Jan 2003 16:12:44 GMT
Hi,

>Can anyone tell me how to make tomcat release memory after a servlet is

You can't.

>finished? Now tomcat simply hold it and sooner or later my server
starts
>to swap processes because of it. It does so even if I force GC at the

You can't force GC.  System.gc() is only a suggestion to the collector
and may be completely ignored.

>end of the servlet. If it is left idle, it frees some over time, but it
>takes to long.

What you can do:

- Allocate more memory to the heap, using the Java -Xmx parameter.
- Better tune your memory profile by changing the ratio of new
generation to old generation.  Sounds like you're 90% new generation.
See the -XX:MaxNewSize, -XX:NewSize (for JDK 1.3 and before) and also
-XX:NewRatio parameter for JDK 1.4 and later.
- Use a different, e.g. incremental (-Xincgc) or concurrent (on JDK 1.4
and later, -Xconcgc) garbage collector.
- Ensure you don't keep references to object you don't need.  If you
keep strong references, the collecto won't deallocate these objects.

Yoav Shapira
Millennium ChemInformatics

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


Mime
View raw message