Getting Started
Clone the repo, install prerequisites, and run your first demo in under 10 minutes.
podman. No Kubernetes cluster required.
1. Clone the Repository
git clone https://github.com/patterncatalyst/spring-boot-optimization.git
cd spring-boot-optimization
2. Install Prerequisites
Every demo runs in containers — you do not need to install Java locally (though it helps for inspection). The minimum set:
Fedora / RHEL
sudo dnf install -y podman git python3
pip install podman-compose --user
macOS
brew install podman git python3
podman machine init --memory 8192 --cpus 4
podman machine start
pip3 install podman-compose
For demos 04, 08, and 09 (JDK 25), the container handles everything — no local JDK 25 installation needed. For the full tool list, see the Prerequisites page.
3. Verify Your Setup
# Podman should report version 4.x or 5.x
podman --version
# Run a quick test container
podman run --rm registry.access.redhat.com/ubi9/openjdk-21:latest java -version
# Verify podman-compose
podman-compose --version
:Z suffix
for SELinux relabeling. If you see "permission denied" errors on mounted volumes,
ensure you're running the provided compose files — they handle this automatically.
4. Run Your First Demo
Start with Demo 01 — it's self-contained, takes 2 minutes, and demonstrates the foundational container-aware JVM configuration that every other demo builds on.
cd spring-boot-demos/demo-01-heap-sizing
chmod +x demo.sh
./demo.sh
The script builds two container images (one misconfigured, one correct) and runs them side-by-side so you can see the difference in heap behavior. Watch for:
- Bad container: JVM reads host RAM, claims a huge heap, gets OOMKilled
- Good container: JVM respects container memory limit (512 MB), heap sized proportionally
5. Next Steps
Demo Walkthrough
Step-by-step guide through all 9 demos with expected output and learning objectives.
Apply to Your App
How to bring these optimizations to your existing Spring Boot applications.
JVM Cheat Sheet
Quick-reference flag table, GC decision tree, and right-sizing formula.
All Demos
Browse all 9 demo pages with source links and run instructions.