Files
spring-boot-demo-oom/scripts/run-all.sh
T

23 lines
1.2 KiB
Bash

#!/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."