From f4697be15935e93776060758b342a638bb3de098 Mon Sep 17 00:00:00 2001 From: jrandom Date: Sat, 19 Jun 2004 23:25:47 +0000 Subject: [PATCH] just a simple catch all for OOM while handling an OOM (naw, we dont recurse too much (just a little)) --- core/java/src/net/i2p/util/I2PThread.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/java/src/net/i2p/util/I2PThread.java b/core/java/src/net/i2p/util/I2PThread.java index 2b53915ca..bdd119735 100644 --- a/core/java/src/net/i2p/util/I2PThread.java +++ b/core/java/src/net/i2p/util/I2PThread.java @@ -43,11 +43,16 @@ public class I2PThread extends Thread { try { super.run(); } catch (Throwable t) { + try { + // we cant assume log is created + if (_log == null) _log = new Log(I2PThread.class); + _log.log(Log.CRIT, "Killing thread " + getName(), t); + } catch (Throwable woof) { + System.err.println("Died within the OOM itself"); + t.printStackTrace(); + } if (t instanceof OutOfMemoryError) fireOOM((OutOfMemoryError)t); - // we cant assume log is created - if (_log == null) _log = new Log(I2PThread.class); - _log.log(Log.CRIT, "Killing thread " + getName(), t); } }