Recently switch to android studio from eclipse. How to check app heap and memory allocation in android studio? In Eclipse we have MAT is there anything in the studio to check heap dump, hprof file?
I'll explain it in an easy way with steps:
First, you have install MAT ( download ) or use:
brew cask install memoryanalyzer
In Android Studio open Android Device Monitor or DDMS.
Select your process "com.example.etc.."
Click Update Heap above the process list.
In the right-side panel, select the Heap tab.
Click in Cause GC.
Click Dump HPROF file above the process list.
When we downloaded the file HPROF, we have to open the Terminal and run this command to generate the file to open it with MAT.
Open terminal and run this command
./hprof-conv path/file.hprof exitPath/heap-converted.hprof
The command "hprof-conv" is in the platform-tools folder of the sdk.