#!/usr/bin/env bash

(
cd /data/tmp/testleak/
rm *.class &> /dev/null
/usr/lib/jvm/java-17/bin/javac *.java

cd lib
rm *.class &> /dev/null

/usr/lib/jvm/java-17/bin/javac *.java

cd ../

echo "Java 17"
/usr/lib/jvm/java-17/bin/java -Xlog:class+unload TestClassloaderLeak

echo ""

echo "Java 21"
/usr/lib/jvm/java-21/bin/java -Xlog:class+unload TestClassloaderLeak
)
