Home » Android » memory leaks – Can't get allocations on Android 4.4.4

memory leaks – Can't get allocations on Android 4.4.4

Posted by: admin May 14, 2020 Leave a comment

Questions:

I tried to get memory allocations for my application in Android Device Monitor.
After I press “Get Allocations” I see console message
[2014-07-03 08:41:36 - ddm-heap] *** Received REAL

My steps.

  1. Run application from Android Studio
  2. Run Android Device Monitor.
  3. Select my application on devices tab.
  4. Press ‘Start Tracking’ on ‘Allocation Tracker’ tab.
  5. Waiting some time.
  6. Press ‘Get Allocations’

How can I resolve this problem and get allocations?
Android 4.4.4, Nexus 4.

Note – the same application and same actions on Android 2.3.7 work.

How to&Answers:

First of all, the message you get is not an error. If you look at the source code you can see the following:

private void handleREAL(Client client, ByteBuffer data) {
    Log.e("ddm-heap", "*** Received " + name(CHUNK_REAL));
    //...
}

It actually means that it received the Allocation information. Note that REAL = a REcent ALlocation response.

You can see that later on in that method, the UI gets updated. Sometimes it fails to show the allocations. Usually it works if you simply click Get allocations again. If that does not work, restart adb and try again. Almost always this solves my issues.