Hacker News new | past | comments | ask | show | jobs | submit login

Why are these relevant or special for the GC in a "gotcha" manner?



Because a static reference causes objects referenced by it to never be GC'd. As a simple hack, someone might add a singleton implemented as a static field of a class. That reference could be/have a structure/collection that accumulates and never gets freed.

You can find these things using the Java Memory Analyzer and the OQL it supports. Sometimes easy sometimes tricky.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: