Flashcards

Quick study sessions to strengthen memory and retain key concepts.

Flashcard Study

Java: OutOfMemoryErrors

Front

When is G1GC preferred over ZGC?

When predictable pause times are needed with moderate heap sizes. G1GC is often chosen for applications where predictable…

View Card →
Flashcard Study

Java: OutOfMemoryErrors

Front

Why does memory leaks on performance matter in practice?

Leads to increased memory usage and potential crashes. A memory leak, like unclosed database connections, gradually consumes more…

View Card →
Flashcard Study

Java: OutOfMemoryErrors

Front

What's the purpose of a Thread Dump?

Provides snapshot of thread states. Frame the concept in practical terms so you can explain it during interview…

View Card →
Flashcard Study

Java: OutOfMemoryErrors

Front

How do G1GC and ZGC differ in pause times?

ZGC aims for lower pause times than G1GC. Frame the concept in practical terms so you can explain…

View Card →
Flashcard Study

Java: OutOfMemoryErrors

Front

How would you explain a Stop-The-World (STW) pause in an interview?

Halts application threads for GC. Frame the concept in practical terms so you can explain it during interview…

View Card →
Flashcard Study

Java: OutOfMemoryErrors

Front

Why are static references a memory leak risk?

Static references prevent eligible objects from being GC'd. In your app, if a static Map stores user sessions…

View Card →
Flashcard Study

Java: OutOfMemoryErrors

Front

Explain the Generational Garbage Collection model?

Divides Heap into Young and Old spaces for efficiency. Objects in Java are allocated in the Young Generation.…

View Card →
Flashcard Study

Java: OutOfMemoryErrors

Front

How does a Heap Dump help in debugging?

Provides a complete memory snapshot for analysis. Heap Dumps can pinpoint areas of excessive memory usage. For instance,…

View Card →
Flashcard Study

Java: OutOfMemoryErrors

Front

Why does Metaspace in JVM matter in this design?

Stores class metadata in Java 8 and later. Unlike the old PermGen, Metaspace grows dynamically, reducing OutOfMemoryErrors related…

View Card →
Flashcard Study

Java: OutOfMemoryErrors

Front

Why does java.lang.OutOfMemoryError occur?

Occurs when JVM can't allocate memory for new objects. When your e-commerce site faces a surge on Black…

View Card →