JVM Memory Layout & GC Algorithms
- Young Generation: Eden Space + Survivor Spaces (S0, S1) for short-lived allocations.
- Old (Tenured) Generation: Long-lived objects surviving multiple GC cycles.
- Metaspace: Native memory holding class metadata and reflection structures.
Essential Production JVM Flags:
java -Xms4g -Xmx4g -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -jar app.jar