I have a couple of services and activities in my application.
When the onDestroy()
method is fired, I currently set all my variables to null. Does this free up memory? Or does Android do that anyway?
Also, what about setting Threads
and Runnables
to null, should you even do that?
Once the user has pressed/tapped "Done" in the activity, I call finish()
on the activity, which then fires the onDestroy()
and I set variables to null.
However, when I go to the Application Manager
> Running Services
, it shows my application is using like 20-25MB of RAM, does Android still keep the activities, even when you call finish()
on them?
PS: When I use a task-manager to kill it, then the memory usage goes down to 4-7MB.