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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to