简体   繁体   中英

android traceview

I made an application and I wanted to see if I can improve performance by running a traceview on a certain activity + it's background tasks.

This link points to an image from traceview. As you can see there are 2 colors that are taking the most time + processor.

  • The blue color is from drawBitmap . (I use a header logo, a repeating header background and another background that repeats over the whole screen, all described in XML layout file).
  • The green color is something called dalvik/system/VMDebug.startGC ()V

My questions:

  1. Can I do something to make this drawBitmap less expensive ? (I would however like to keep all images on the screen)
  2. What is this VMDebug thing? Can't seem to find much about it via Google

It sounds like you may be able to optimize your bitmap drawing,(you mention a background that is drawn repeatedly)

VMDebug is the dalvik debug monitor the startGC() function is called to start garbage collection

1) Try this answer to make drawBitmap less expensive

2)VM-specific debug features. Though this class and many of its members are public, this class is meant to be wrapped in a more friendly way for use by application developers. On the Android platform, the recommended way to access this functionality is through the class android.os.Debug.

More Details

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM