Monday, June 8, 2009

Android java space profiling tool - traceview

Android provides a good java space profiling tool: traceview. Traceview can be found in the same folder as adb in Android SDK package. Usage is quite simple and straightforward:
  1. import android.os.Debug;
  2. Debug.startMethodTracing("tag-name");
  3. Debug.stopMethodTracing();
  4. Run the Java application
  5. Fetch out the profiling output file on SD card (SD card is needed) root folder: tag-name.trace
  6. traceview tag-name.trace to open the traceview window
Insert items 1, 2, 3 into your java source code where you want to do profiling.
For more information about traceview window, refer to http://developer.android.com/guide/developing/tools/traceview.html

No comments:

Post a Comment