So basically auto-start if you run out of memory. You can poll memory (Runtime.getRuntime().freeMemory()) and run System.gc() if you hit the high-water mark. If that fails to return sufficient memory you could bail: harikari(). I'd read this though because the first gc() isn't guaranteed to recover everything. It depends on the complexity of the object graph and the gc mode you're running and so forth. I would be inclinded to reduce your footprint, find the "leaks" and start using weak references in key areas before going that route.
http://java.sun.com/docs/hotspot/gc/ ----- Original Message ----- From: "Joe Hung" <[EMAIL PROTECTED]> To: "Jboss-User (E-mail)" <[EMAIL PROTECTED]> Sent: Wednesday, February 19, 2003 9:24 AM Subject: [JBoss-user] how to exit jboss when out of memory > I know I should not write code that ran out of memory. but, some things are > just not unexpected. ;) > > Anyway, is there a way to tell jboss to exit (process exit) when it's > running out of memory? Our system has a way to restart as long as it exists. > In this case I'd like jboss to shut down rather than trying to figure out > what's wrong. > > thanks in advance! > > -joe > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. > The most comprehensive and flexible code editor you can use. > Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. > www.slickedit.com/sourceforge > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user ------------------------------------------------------- This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. The most comprehensive and flexible code editor you can use. Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. www.slickedit.com/sourceforge _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user