4 ms·
Is there a nice idiom name that represents ensuring that an object gets "released" and eligible for garbage collection?
by a3n 6y ago
Is there a nice idiom name that represents ensuring that an object gets "released" and eligible for garbage collection?
- CraigJPerry 6y agoMemory leaks in Java are usually not so bad to fix. Maybe some off-heap scenarios could be trickier but IME people are pretty careful if they’re going to the extremes of off-heap. Memory leaks in enterprise java in my experience are usually things like forgetting to close a resource of some sort or maybe doing something silly like continually growing a set or map with duplicate objects because of faulty equals() or hashCode(). Both of these cases are well covered by static analysis. Maybe the trickiest but still relatively common scenario is a design issue where a weak reference is required - i guess that fits parent description pretty well.
- varjag 6y agoresource management