Re:LeakCanary: Detect all Android memory leaks
by gumballhead on Friday May 08, 2015 @09:24PM
(#9515040)
From what I've seen, Java's GC is smart enough to clean up circular references. That actually surprised me. The main danger I've seen in Android is that there is a lot of passing around Contexts as a dependency for accessing Android resources, many of which are meant to be short lived, like Activities. Sometimes a class will save that context as an instance variable. And sometimes you might want to cache that class statically, so if you aren't careful, you'll prevent something like an Activity from garbage collection.
[ Parent
| on HN ]
There are no comments on this comment yet.