0

I am trying to precisely measure the total amount of memory used by my application. I am developing a .so library that utilizes GPUs on the phone devices. I am mostly using C/C++ and OpenCL in my development, hence, all my memory allocations are either new/delete or clCreateBuffer/clReleaseMemObject.

Precisely, I am looking for the following values:

  1. Total memory used on the heap
  2. Total memory used on the stack (if possible)
  3. Total memory used for the OpenCL buffers

What I did:

I used dumpsys to collect some numbers using the following command:

adb shell dumpsys meminfo com.example.hellolibs.debug -d

And, I also wrote some simple profiling code to track all the OpenCL buffer allocations/frees (I am tracking the reference counters of the underlying OpenCL buffers). The total memory usage that I am measuring using my profiling code is bigger than what dumpsys is reporting using the above command. It shouldn't be like that, right?

My target platform is: ARM CPUs with Mali GPUs

mgNobody
  • 738
  • 7
  • 23

1 Answers1

1

Sounds like you want Streamline, a performance profiler that is part of Arm Mobile Studio: https://developer.arm.com/tools-and-software/graphics-and-gaming/arm-mobile-studio/components/streamline-performance-analyzer

Mobile Studio is free, and there are some good video tutorials for it.

BenClark
  • 338
  • 2
  • 12