How to analyze graphics memory usage by Skia

943 views
Skip to first unread message

Arko Nasipuri

unread,
Nov 10, 2017, 10:17:16 AM11/10/17
to skia-discuss
This question is not strictly related to Skia.
But I haven't had much luck in more general public forums. So posting it here.

I have an Android application that uses Skia with OpenGL backend.
As we know, Android devices typically have a unified memory architecture where the same system RAM is shared between CPU & GPU.
Now Skia will be creating (and caching) a lot of OpenGL ES resources, and because of the unified architecture these resources will reside in system RAM.
Therefore, the total system RAM consumed by my application will be due to both CPU & GPU. And as I understand, the GPU component of RAM usage will not be trivial.

I want to measure the *total* RAM consumption.
I have tried using the 'adb shell dumpsys meminfo' utility. One of the components reported by this command is called 'GL mtrack', which seems to be the OpenGL RAM usage that I am looking for.
At least, that is what I understand from the following post on stackoverflow:

Now we come to the interesting part:
I am not getting the 'GL mtrack' component on all Android devices. The adb command reports it on some devices, and doesn't on other devices.
Consequently, the memory consumption of my app is reported incorrectly on some devices.
I thought that the issue might be with some specific graphics drivers. But then I came across an interesting case:
A Nexus 6P device on Android O reports this component, but another Nexus 6P device on Android M doesn't.

Any thoughts on why certain devices are not reporting the GPU memory usage?
Also, in general, how do I measure the graphics memory usage of my Skia-based application?
Reply all
Reply to author
Forward
0 new messages