how to test the performance of an android application

how to test the performance of an android application  using -'android,performance,testing'

asked Oct 11, 2015 by amit.gupta
0 votes

4 Answers

0 votes

If you want to profile your application to find performance bottlenecks you can use the traceview tool. This gives you a graphical view of performance traces of your application.


To create a trace add the following to your code where you want to start tracing:


and then put the following when you want to stop tracing:


This will create a trace file call myapp.trace in the root directory of the SD Card. As it is written to the SD Card:

  • If you're using the emulator you'll need to add an SD card to your AVD.
  • You'll need to give you app permission to write the SD card by adding the following to your Manifest:

Once the file has been created you'll need to copy it to your PC. You can do this using the adb command:

adb pull /sdcard/myapp.trace c:/my/dir/myapp.trace

Finally, start traceview giving it the full path to the trace file:

traceview c:/my/dir/myapp.trace

I did have some problems with traceview failing with OutOfMemory exceptions. I fixed this on Windows by changing the last line of traceview.bat from:

call java -Djava.ext.dirs=%javaextdirs% -jar %jarpath% %*


call java -Xmx1g -Djava.ext.dirs=%javaextdirs% -jar %jarpath% %*

Adding the -Xmx1g option allows traceview to use more memory.

answered Oct 11, 2015 by akhilesh
0 votes

Also, theoretically, DDMS can get memory allocations for your program and then you can analyze the dump using profilers. DDMS Reference.
The reason why I have theoretically in italics is that I myself have not tried doing anything such, yet.

answered Oct 11, 2015 by tejas lakhani
0 votes

(Disclaimer: I am the co-founder of the company referred below)

Would recommend trying out Little Eye for doing your performance analysis of Android apps. It allows you to instantly measure various performance attributes of your application, including power consumption, CPU, memory, network data, disk space usage, etc. It also combines this with a very useful recording of the entire screen activity and also internal app activities (including logs, threads etc), so that it becomes very easy to correlate consumption with user activities and the app activities.

And unlike DDMS, this can work on ALL apps including production apps. Making comparison with your competition quite easy too.

Check it out and hope this helps. :-)


Since The Little Eye team is joining Facebook they are not accepting new signups right now!

answered Oct 11, 2015 by manju bhargava
0 votes

I think traceView contains too much information, you can easily get lost.

My solution is just log the system time at three place in the code.

Before and after and center at the potiential slow code.

like binary search, next time, narrow it down step by step, then finally find the culprit code.

answered Oct 11, 2015 by gauravsinghal83