Is there a way to get the GPU memory usage on Android (Mali) ?

I am looking for a way to read the GPU memory usage of my Game (process) on the Mali GPUs on Android platform.

On some other GPU's I can read the entries in /proc/<pid>/smaps and calculate the GPU memory usage from the page mapping

entries, but on Mali devices they don't seem to add up to the actual memory usage in my test app (uploads 1k by 1k textures, 32bpp, and renders

every texture in every frame).

I've read that for Mali GPU's ion is used to allocate memory, but I can't seem to find a way to get the GPU memory usage. Ideally, I would like to

somehow find these numbers:

   - how much graphics memory can be allocated until we run out of memory?

   - how much of graphics memory is currently being used by the process in terms of actually allocated (dirty) memory pages?

   - if memory is allocated as a dedicated heap of 4K pages as a large chunk, how much of that heap is actually currently allocated?

The use case is for internal development (I work for a mobile game studio) work, but ideally it should be usable without rooting or

otherwise modifying the device (code can be inserted into the game to read it, but it runs with user rights).

Cheers,

                                 Jani

More questions in this forum