I believe DDMS has much of what you need. For code profiling, search for 'TraceView'
* you will want to add some UI to your app to let you toggle tracing on and off, so you can capture samples while your code is doing the thing you're interested in improving. For memory leak checking, you need to run the full DDMS (not the DDMS panel in eclipse), and you ideally should use that full DDMS to launch the app (either on a emulator or a real phone). If you let eclipse launch it, it will probably grab the access port and then the full DDMS won't be able to connect and you will scratch your head wondering why. You might start here: http://developer.android.com/guide/developing/tools/traceview.html http://developer.android.com/resources/articles/avoiding-memory-leaks.html http://developer.android.com/resources/articles/track-mem.html Note that TraceView might have a memory limit preventing you from capturing enough data. You can get around that by editing your copy of traceview.bat (in the sdk/tools folder I recall)... there is a line near the end that you change to look something like this: call %java_exe% -Xmx1024m -Djava.ext.dirs=%javaextdirs% - Dcom.android.traceview.toolsdir= -jar %jarpath% %* it's that "-Xmx1024m" that you change (it defaults to something smaller) And if you trace on a real phone, don't forget to give your app permission to write to the SDCARD. I believe the instructions imply you (in the emulator) can toggle tracing with F9 without needing to formally call: Debug.startMethodTracing("calc"); //==== <things get profiled> Debug.stopMethodTracing(); //==== But that has not worked for me.So I always call those functions (at run time) to start/stop my sampling. On Sep 12, 1:09 pm, Sohan badaya <sohan.bad...@gmail.com> wrote: > Hi All, > > I would like to know is there any tool in android to find memory leak > and code optimization. > > Thanks, > Sohan Badaya -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en