As other have stated, Java Objects are garbage collected:

If an Object cannot be reached (from any of the current threads' 
stack-frames or from the heap), directly or indirectly, i.e. there is no 
path to the Object, then this Object can be garbage collected. 
It is impossible to 'delete' an Object in Java.

You can help (just 'help', not force) the garbage collector along a little, 
by setting references to null ("b = null;" in the above examples). However, 
this hardly helps the garbage collector at all. It's not of much use.

You can call System.gc() to indicate that the garbage collector should run 
a.s.a.p. Again, this may or may not work, since calling 'gc()' is only a 
hint. The actual behavior may vary.

If you're dealing with bitmaps, calling bitmap.recycle() may work for you to 
free up memory. Be careful doing this. Make sure other parts of your code 
don't still have a reference to this and use the now recycled bitmap,.

My answer is another question to you:
*Why do you want to know this?*

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to