|
@@ -4,7 +4,6 @@ import lombok.AllArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
|
import static org.cobbzilla.util.daemon.ZillaRuntime.shortError; |
|
|
import static org.cobbzilla.util.daemon.ZillaRuntime.shortError; |
|
|
import static org.cobbzilla.util.daemon.ZillaRuntime.stacktrace; |
|
|
|
|
|
|
|
|
|
|
|
@AllArgsConstructor @Slf4j |
|
|
@AllArgsConstructor @Slf4j |
|
|
public class OutOfMemoryErrorUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler { |
|
|
public class OutOfMemoryErrorUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler { |
|
@@ -18,7 +17,7 @@ public class OutOfMemoryErrorUncaughtExceptionHandler implements Thread.Uncaught |
|
|
@Override public void uncaughtException(Thread t, Throwable e) { |
|
|
@Override public void uncaughtException(Thread t, Throwable e) { |
|
|
if (e instanceof OutOfMemoryError) { |
|
|
if (e instanceof OutOfMemoryError) { |
|
|
try { |
|
|
try { |
|
|
log.error("!!!!! OutOfMemoryError: calling System.exit("+status+") from: " + stacktrace(t)); |
|
|
|
|
|
|
|
|
log.error("!!!!! OutOfMemoryError: calling System.exit("+status+")", e); |
|
|
} catch (Throwable ignored) {} |
|
|
} catch (Throwable ignored) {} |
|
|
System.exit(status); |
|
|
System.exit(status); |
|
|
} else { |
|
|
} else { |
|
|