I've been using Eclipse MAT (http://www.eclipse.org/mat/) to look at heap dumps. My phone isn't rooted so I run my app in the emulator then use adb to do a kill -10 which forces a heap dump. I then do an adb pull to grab the file (your logcat will give you the name of the heap dump output file when it runs). Then I use the android hprof-conv tool to convert the heap dump to one that MAT can read. Then just open it up in MAT and you can look around through the dump. It will also suggest leak candidates to you, it's a nice tool. Also, you will need to grant write permissions to the output directory in your emulator. I just go do a chmod 777 /user/data.
hth, Sean Overby On May 20, 6:27 am, Jiang <[email protected]> wrote: > When start Activity A, I found the memory usage of application is about 5MB, > > Then start Activity B from A via startActivity. In Activity B, I created a > thread, and traverse file system in this > thread, after traversing completed, call finish() and to return to Activity > A. at this time, I found the memory usage of application is about 8MB (GC is > forced before check memory usage). > > How to find Where memory leaks? > > By the way, I checked the memory usage with DDMS. > > Thanks. > > -- > 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 > athttp://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

