Checking the Android App Memory Trace with Profiler

Dhananjay Trivedi
2 min readMar 22, 2019

--

I was always busy with learning and experimenting with the latest Android concepts and never got time to dig more about the Profiler. I knew it was there, but always procrastinated to learn more about it even though it’s such an important aspect of Android Application Development.

Today while working on one of my projects, I looked into the Android Profiler and saw a huge spike in Application’s Memory Consumption and felt really surprised to see that huge spike of memory even though the app was doing pretty much nothing on the start.

So, I wanted to compare the my already ongoing app with a fresh new app which does nothing, so I created the default ‘My Application’ Android Studio Project and ran it on my Oppo Realme 2 running Android Oreo.

Here is what the profiler looks like for the default new project:

Looking into the spike it shows the breakdown of the memory being used

So I further tried running the same ‘My Application’ on an emulated device, Nexus 6 running API 28 & here is the profile look for that.

In details:

So the Android Device you are running your app on does affect your app’s performance, and might give you some shocking results like here,

The native memory consumption for emulated device for 42MB while that of Oppo Realme 2 was 283.5MB. So the very obvious conclusion is that I should not be using my phone to check the the app’s performance in the profiler.

Will add more with time here as I learn more about it, but this was something I learned and wanted to share.

--

--

Dhananjay Trivedi
Dhananjay Trivedi

Written by Dhananjay Trivedi

Android | Flutter | App Developer | Product Management | Prompt Engineer who loves writing and sharing knowledge

No responses yet