tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Balazuc" <>
Subject Re: Known Memory clean-up issues?
Date Thu, 29 Nov 2001 20:42:28 GMT
Hi all

Where would you recommend to use System.gc() in the context of JSP pages ?
I guess it would be useless to intercept every single request and hint the
system for garbage collection on each request ?

(Now I quote)
"Also, before an OutOfMemory is thrown, the Garbage collector is
guarenteed to run, meaning that you really are using all of your memory.  I
would look at what you are doing in your code - I have servlets that run for
weeks without eating up any significant portion of memory"

I do have many times OutOfMemory exceptions thrown, although we're not doing
*that* much....
It happens quite randomly so it's very difficult to isolate the problem.
Moreover, it even happens when fetching HTML pages from Tomcat, without
using much JSP...
I'd like to find a place to catch that error to take action (like restarting
Tomcat) but the only way we have found is to monitor the server and
automatically restart it when it fails to respond.

Any guidance to solve the problem would be appreciated ;-)

Denis Balazuc

----- Original Message -----
From: "Yoav Shapira" <>
To: "Tomcat Users List" <>
Sent: Thursday, November 29, 2001 03:07 PM
Subject: Re: Known Memory clean-up issues?

> Howdy,
> > Any harm in forcing garbage collection to run?
> You cannot force garbage collection to run, only suggest it to the
> JVM via methods like System.gc().  If you're having difficulty
> tracking down memory usage, try a profiler like OptimizeIt that has
> entire memory trees.
> In addition, you can use parameters like hprof and verbosegc on
> the java command line to assist you in monitoring garbage collection.
> Yoav Shapira
> --
> To unsubscribe:   <>
> For additional commands: <>
> Troubles with the list: <>

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message