There is no need to do this whatsoever. And you cannot "recycle" Views
anyway, at most you can set all the references to null manually which will
not make much of a difference. The GC will eventually collect the ListView
instances.

On Thu, Mar 31, 2011 at 11:32 AM, Matthew Powers <[email protected]> wrote:

> I have played with this MANY times.  The only solution I have seen is to
> walkthetree in the listview and recycle your objects by hand
>
> On Thu, Mar 31, 2011 at 2:08 PM, ivan <[email protected]> wrote:
>
>> Ok I just tested the api demo again.
>>
>> I went in and out of List1.java 15 times, and only saw 8 instances
>> still on the heap.
>>
>> So, clearly "some" are being GC'd.
>>
>> My question still remains... Why doesn't this happen with other views?
>>
>> On Mar 31, 11:50 am, ivan <[email protected]> wrote:
>> > So to reiterate ...
>> >
>> > I can see every instance of a ListView/ListActivity (ever created)
>> > sitting around in memory, even though I force a GC in every call to
>> > onDestroy().
>> > ... And this is the expected behavior, because the Dalvik GC will
>> > "eventually" collect them.
>> >
>> > Why isn't this the case with other views?
>> >
>> > On Mar 31, 10:28 am, Mark Murphy <[email protected]> wrote:
>> >
>> > > On Thu, Mar 31, 2011 at 11:58 AM, ivan <[email protected]> wrote:
>> > > > Incoming references and path to GC root show only the
>> TmpTestActivity.
>> >
>> > > If I am understanding you correctly, then, it is merely a matter of
>> > > them not having been GC'd yet. Bear in mind that the Dalvik GC
>> > > implementation does not try to reclaim all unreferenced objects in a
>> > > single pass.
>> >
>> > > --
>> > > Mark Murphy (a Commons Guy)http://commonsware.com|
>> http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>> >
>> > > Android Training in NYC:http://marakana.com/training/android/
>>
>> --
>> 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
>
>
>  --
> 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




-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them

-- 
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