diff --git a/src/main/java/de/avatic/lcc/config/ShutdownListener.java b/src/main/java/de/avatic/lcc/config/ShutdownListener.java index f2f35b0..efc907d 100644 --- a/src/main/java/de/avatic/lcc/config/ShutdownListener.java +++ b/src/main/java/de/avatic/lcc/config/ShutdownListener.java @@ -14,6 +14,14 @@ public class ShutdownListener { @EventListener public void onShutdown(ContextClosedEvent event) { log.error("Application shutdown. Context: {}, Thread: {}", event.getApplicationContext(), Thread.currentThread().getName()); + + Runtime runtime = Runtime.getRuntime(); + long usedMemory = (runtime.totalMemory() - runtime.freeMemory()) / 1024 / 1024; + log.info("Memory: {} used, {} total, {} free, {} max ", usedMemory, runtime.totalMemory() / 1024 / 1024, runtime.freeMemory() / 1024 / 1024, runtime.maxMemory() / 1024 / 1024); + + + + log.error("Application shutdown. Context: {}, Thread: {}", event.getApplicationContext(), Thread.currentThread()); log.error("Thread stack dump:"); Thread.dumpStack(); }