mgNobody
mgNobody

Reputation: 778

Profiling memory usage (heap, stack, OpenCL buffers for GPUs) on the Android devices

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

Upvotes: 1

Views: 558

Answers (1)

Ben Clark
Ben Clark

Reputation: 477

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.

Upvotes: 1

Related Questions