In this document
You should also read
This walkthrough shows the basic usage and workflow for the Heap Viewer tool. Heap Viewer
reports in real-time what types of objects your application has allocated, how many, and
their sizes on the heap.
What it's good for:
- Getting a sense of how your app allocates and frees memory.
- Identifying memory leaks.
Prerequisites
Working with Heap Viewer
- Connect your mobile device to your computer.
- Open your application in Android Studio, build the source, and run it on your device or
emulator.
- Start the Android Device Monitor from Android Studio: Tools -> Android
-> Android Device Monitor.
Alternatively, you could start the Memory Monitor
in Android Monitor.
- In the device and application drop-downs, select the app you want to monitor.
- To save a heap dump, click the Dump Java Heap icon. The heap snapshot file
with the filename
Snapshot-yyyy.mm.dd-hh.mm.ss.hprof appears in the
Captures tab.
- Note the Heap updates will happen
after every GC for this client. message.
- Click the Initiate GC icon to
trigger a garbage collection event.
- Double-click the heap snapshot file to open the heap viewer and see detailed information
about the current allocations on the heap.
This site uses cookies to store your preferences for site-specific language and display options.
This doc is hidden because your selected API level for the
documentation is . You can change the
documentation API level with the selector above the left navigation.
For more information about specifying the API level your app requires,
read Supporting
Different Platform Versions.