| page.title=GPU Monitor |
| parent.title=Android Monitor |
| parent.link=android-monitor.html |
| meta.tags="android, performance, profiling, tools, monitor" |
| page.tags="android", "performance", "profiling", "tools", "monitor" |
| page.metaDescription=Use the GPU Monitor for a visual representation of how much time it takes to render the frames of a UI window. Use this information to optimize the code that displays graphics and conserve memory. |
| page.image=tools/help/thumbnails/am-gpumon.png |
| page.article=true |
| |
| @jd:body |
| |
| <div id="qv-wrapper"> |
| <div id="qv"> |
| <h2>In this document</h2> |
| <ol> |
| <li><a href="#running">Displaying a Running App in the GPU Monitor</a></li> |
| </ol> |
| |
| </div> |
| </div> |
| |
| <p> |
| The GPU Monitor gives you a quick visual representation of how much time it takes to render the |
| frames of a UI window. It profiles the amount of time it takes for the render thread to prepare, |
| process, and execute the draw commands. The GPU Monitor can help you to: |
| </p> |
| |
| <ul> |
| <li>Quickly see how a UI window performs. |
| </li> |
| |
| <li>Identify whether any part of the rendering pipeline stands out in using processing time. |
| </li> |
| |
| <li>Look for spikes in frame rendering time associated with user or program actions. |
| </li> |
| </ul> |
| |
| <p> |
| For example, if displaying a static photo continues to take Graphics Processor Unit |
| (GPU) resources long after it has finished |
| drawing on the screen, that’s a likely candidate for optimization. |
| </p> |
| |
| |
| <h2 id="running"> |
| Displaying a Running App in the GPU Monitor |
| </h2> |
| |
| <p> |
| To display an app running on a particular device or emulator in the GPU Monitor: |
| </p> |
| |
| <ol> |
| <li>Meet the <a href= |
| "{@docRoot}tools/help/am-basics.html#byb">prerequisites and dependencies</a>. |
| </li> |
| <li>Open an app project. |
| </li> |
| <li><a href= |
| "{@docRoot}tools/building/building-studio.html#RunningApp">Run the app</a> on a hardware device or |
| emulator. |
| </li> |
| <li> |
| <a href="{@docRoot}tools/help/am-basics.html#displaying">Display Android Monitor</a>. |
| </li> |
| <li>Click the <strong>Monitors</strong> tab and <a href= |
| "{@docRoot}tools/help/am-basics.html#rearranging">display the GPU Monitor</a>. |
| </li> |
| |
| <li>Enable the GPU Monitor by clicking Pause <img src="{@docRoot}images/tools/am-ipause.png" |
| style="vertical-align:sub;margin:0;height:17px" alt="Pause icon" /> to deselect it. |
| </li> |
| |
| <p> |
| Any GPU usage begins to appear in the GPU Monitor: |
| </p> |
| <img src="{@docRoot}images/tools/am-gpumon2.png" style="vertical-align:sub;margin:0" /> |
| |
| <p> |
| The y-axis is the amount of time it takes the GPU to execute, process, prepare, and draw frames, |
| in milliseconds. The x-axis records the time elapsed; it starts with seconds, and then minutes |
| and seconds, and so on. |
| </p> |
| |
| <li>To stop the GPU Monitor, click Pause <img src="{@docRoot}images/tools/am-ipause.png" style="vertical-align:sub;margin:0;height:17px" alt="Pause icon" /> again to select |
| it. |
| </li> |
| </ol> |