0

I want to collect the number of allocated objects (java object) in each method of an Activity in an Android application. For example,

void onCreate(...) {
...
...
ObjectType1 obj1 = new objectType1();
ObjectType1 obj2 = new objectType1();
}
 

In the above code snippet, two objects of type ObjectType1 was allocated. I want to get this allocation count information and collect it into a CSV file.

I am familiar with Android Profiler and can get the Allocation count when arranged by callstack.

My question is, is it possible to dump that memory allocation data and parse them into a suitable format somehow?

N.B.: I am only interested in Java objects allocated from the application side.

tahiat
  • 116
  • 8

1 Answers1

0

Android Studio Profiler doesn't have this functionality. I suggest you open a feature request. You can click "File > Submit Feedback" from Android Studio, and change the issue type from "Bug" to "Feature Request".

Shukang Z
  • 101
  • 3