On 15/11/2010 17:39, Tim Funk wrote:
> Has anyone successfully used (or experimented with) either of these?
> 
> -XX:OnError="<cmd args>;<cmd args>"
> -XX:OnOutOfMemoryError="<cmd args>;
> <cmd args>

Yes.

Context: an occasional app bug which started occurring with more
frequency, under load.  Couldn't track down the source easily and it was
bringing the system down.

Automatically restarting the server process turned out to be a bad idea,
as the side-effect was that the heap dumps (also configured) got
corrupted with a reasonable degree of frequency.  (If you kill the JVM
during heap write the dump borks, & I needed the heap dumps.)

I tried with a short delay, but that didn't seem to help matters.

I also experienced cyclic reload & failure conditions.

What did work: creating a fail file, which a polling process would check
for periodically & restart the server when the fail file was a certain
age (which managed to be 2mins).

If more than 3 fail files existed, wait longer for a restart.

If more than 5 existed, don't restart.  External alerting systems
notified me that the system was down.


This worked until I'd resolved the actual issue.



p

Attachment: 0x62590808.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to