-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chuck,
Caldarale, Charles R wrote: >> From: Christopher Schultz [mailto:[EMAIL PROTECTED] >> Subject: Re: Thread Dumps/ Emailing Results... >> >> I have written a script to check for OOMs by checking catalina.out >> for "OutOfMemoryError". When such an error is detected, I run the >> following commands (apologies for the line wrapping): > > An easier way to get the heap dump on a modern HotSpot JVM is to add the > command-line option: > -XX:+HeapDumpOnOutOfMemoryError I noticed that, but we only run our OOM-check every 5 minutes, and we want to avoid getting too much extra stuff in our email notifications. If the thread dump happened a few minutes before, then we might not get an up-to-date thread dump. One could argue that the exact timing of the thread dump is not particularly relevant; merely having one /is/ useful. Dumping threads at the time of the OOME would probably be better. > Also, in JDK 6 and above, there's another intriguing option: > -XX:OnOutOfMemoryError="<command>" That's pretty cool. For the time being, we're on JRE 1.5, so that's not an option. I'll look into it as we look forward to upgrading. > The above will run an external command to do whatever you deem > appropriate, such us running the thread dump script you provided. It would be great if that command could be parameterized and, say, take something like the thread dump on standard input. If you know anyone at Sun, feel free to give them that idea ;) - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkkQzUcACgkQ9CaO5/Lv0PADZACgqgA/aL47vYm50iF2g50VhQy4 40oAnRCS2tcjNiecOPsJEdlU/jgRlDlD =75eD -----END PGP SIGNATURE----- --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]