You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Reynir Hübner <re...@hugsmidjan.is> on 2003/04/15 17:48:36 UTC

[partially off topic] How can I detect java.lang.OutOfMemoryError

Hi, 

I am trying to find a good way to detect and handle java.lang.OutOfMemoryError. 
There are obvious problems to this, if this error occures the VM is basically "crashed" but not dead, it cannot allocate more memory. 

I would like to handle such errors by sending an email to the system administrator and restarting the service running tomcat, and maybe even add few megabytes to the Xmx JVM parameter. 

Just for the record, I know what causes the OutOfMemoryError, and it's not really an error or anything, it's just pure load, and of course it's always possible to adjust some things around the server, for example shorten the session timeouts, so sessions data would be garbage-collected faster.

As I said the server is under a lot of continuous load, and this error happens when someone does something very memory-demanding, for example I've seen it happen when using the reload function in the manager application.

So, now I'm wondering what is the best way of detecting the error ?
I'm using windows 2000 servers...

Thanx
-reynir






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