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 ;-)

Thanks
Denis Balazuc


----- Original Message -----
From: "Yoav Shapira" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
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:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to