I too am finding a memory leak with the listview but no one has been able to tell me if I am doing anything wrong.
I made a post on stackoverflow about it with sample code (dead simple example of a listview leaking there is a link to the whole project as a zip on the post as well). http://stackoverflow.com/questions/4218359/my-simple-listview-app-is-leaking-memory-what-am-i-doing-wrong If anyone could point out what im doing so terribly wrong with my code it would be much appreciated. TZ On Oct 22, 5:41 am, John Gaby <[email protected]> wrote: > First, let me say that this is just a very simple sample application > to illustrate the problem. My real application is far more complex, > but exhibits this same behavior. > > What I need to be able to do is to be able to destroy a given page and > then re-create it later. There are several reasons for this, but one > of the main ones is that I want to free up the memory of a page which > is no longer being actively used. Then when the user loads that page > again, I simply re-create it. In Java, of course, there is really no > way (that I know of) to free objects, you simply stop referring to > them and the the garbage collector magically disposes of them at it's > leisure. The problem is that it is simply NOT doing that for my > GListView objects. > > I realize that this application doesn't represent something that you > might actually do, but the fact is that if you take this program and > run it, the GListView objects are NEVER freed, causing a memoryleak. > This is what I am trying to address. If I can understand why this is > happening in this simple case, I might be able to figure out how to > fix it in my actual program. > > Thanks. > > On Oct 22, 1:26 am, Doug <[email protected]> wrote: > > > On Oct 21, 9:29 pm, John Gaby <[email protected]> wrote: > > > > There cannot be this kind ofleakin general can there? > > > No, there cannot. > > > You strategy looks foreign to me. Can you explain in english what > > you're trying to do and the strategy you're using to implement it? > > Why are you calling your CreateLayout twice in onCreate? And even > > worse, why are you calling it at all in an your onClick handler? > > > Doug > > -- 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

