Browse Source

show stack of oome, not thread

tags/2.0.1
Jonathan Cobb 4 years ago
parent
commit
8741752cf0
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      src/main/java/org/cobbzilla/util/system/OutOfMemoryErrorUncaughtExceptionHandler.java

+ 1
- 2
src/main/java/org/cobbzilla/util/system/OutOfMemoryErrorUncaughtExceptionHandler.java View File

@@ -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 {


Loading…
Cancel
Save