Skip to content
Sharp

Performance Tuning · interview question

How can static references cause memory leaks in Java?

Multiple choiceHardchapter-14-curatedpremiumperformance-tuningoutofmemoryerrors
Choose one answer
Answer and explanation

Correct answer

C. Static references persist for the lifetime of the application, preventing GC of objects.

Why

Static references in Java remain in memory for the duration of the application's lifetime. If they reference objects that are no longer needed, those objects cannot be garbage collected, leading to memory leaks.

Test yourself on Performance Tuning

A free test with instant, explained results. No account needed.

Start free test
All Performance Tuning questions →