Android Memory Leaks Understanding
I am reading the book called 'Effective Java' by Joshua Bloch and there is a piece of code which leads to memory leaks. public class Stack { private Object[] elements; private in
Solution 1:
// TODO: mArrayList = null to prevent memory leaks. Is it necessary to do it?
No, the activity object and its members such as mArrayList
can be garbage collected. Your activity code does not show anything that would hold object references unnecessarily long.
Post a Comment for "Android Memory Leaks Understanding"