users@glassfish.java.net

Re: How to use -XX:OnOutOfMemory with GlassFish

From: <glassfish_at_javadesktop.org>
Date: Tue, 12 May 2009 02:43:15 PDT

Does no one has an idea, how to restart GlassFish in case of an OutOfMemory event? I think this is an important issue for robust usage of GlassFish in production environment. If an JVM runs in an OutOfMemory situation, it is not longer stable usable - the only thing to do is to restart the process. The only way I know to realize this, is the use of this JVM argument for SUN JVM's:

Unix:
-XX:OnOutOfMemoryError="kill -9 %p"

Windows:

-XX:OnOutOfMemoryError="taskkill /F /PID %p"

Any ideas to realize this with GlassFish on SUN JVM's (Java 6) ?



Btw. JRockIT has a little bit different (easyier) way to achive this:
-XXexitOnOutOfMemory

I don't know if this is possible also with SUN JVM's.

Thanks,
 Frank
[Message sent by forum member 'fmeili' (fmeili)]

http://forums.java.net/jive/thread.jspa?messageID=345897