4 ms·
Why are these relevant or special for the GC in a "gotcha" manner?
by Brystephor 4y ago
Why are these relevant or special for the GC in a "gotcha" manner?
- karmakaze 4y agoBecause 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.