spring-boot-demo-oom: five real memory-leak demos with captured OOM + MAT evidence

This commit is contained in:
2026-10-01 12:11:56 +00:00
commit fd035a79e8
41 changed files with 1317 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Regenerates every file under */docs/output/ from scratch: builds all five modules, runs each
# to a real OutOfMemoryError with a real heap dump, then runs that dump through Eclipse MAT's
# headless batch report and re-extracts the leak-suspect summary.
#
# Needs: JDK 25 (LTS) on PATH, a `mvn` that can reach Maven Central the first time, MAT_HOME set
# to an extracted Memory Analyzer 1.17.0+ distribution, and xvfb-run on PATH.
set -eu
cd "$(dirname "$0")/.."
: "${MAT_HOME:?Set MAT_HOME to your Memory Analyzer install}"
for mod in static-cache-leak threadlocal-leak listener-leak classloader-leak unbounded-queue-leak; do
echo "================================================================"
echo "== $mod =="
echo "================================================================"
(cd "$mod" && ./scripts/run.sh)
(cd "$mod" && ./scripts/mat-report.sh)
echo "-- regenerate $mod/docs/output/01-oom-console.txt and 02-mat-leak-suspects.txt from the"
echo " run.sh/mat-report.sh output above using the same trimming rules documented in README.md --"
done
echo "done. Each module's docs/output/ holds 01-oom-console.txt and 02-mat-leak-suspects.txt."