2

One of the metrics in the UI Performance testing in android is "Total Memory Usage". What is it exactly?

The command is adb shell dumpsys gfxinfo <PACKAGE_NAME>

A sample dumpsys is available here : https://gist.github.com/anonymous/20c263d802ab60cb0d1a

500865
  • 6,920
  • 7
  • 44
  • 87

1 Answers1

0

In your particular example Total memory usage is sum of all caches allocated memory in Android HWUI library

Caches:
Current memory usage / total memory usage (bytes):
  TextureCache         74625498 / 75497472
  LayerCache            3538944 / 50331648 (numLayers = 3)
    Layer size 1440x810; isTextureLayer()=1; texid=24 fbo=0; refs=1
    Layer size 1440x810; isTextureLayer()=1; texid=42 fbo=0; refs=1
    Layer size 1440x810; isTextureLayer()=1; texid=48 fbo=0; refs=1
    Layer size 1344x192; isTextureLayer()=0; texid=40 fbo=0; refs=1
    Layer size 1472x192; isTextureLayer()=0; texid=41 fbo=0; refs=1
    Layer size 1344x256; isTextureLayer()=0; texid=23 fbo=0; refs=1
  Layers total   17535744 (numLayers = 6)
  RenderBufferCache           0 /  8388608
  GradientCache           32768 /  1048576
  PathCache                1260 / 33554432
  TessellationCache           0 /  1048576
  TextDropShadowCache         0 /  6291456
  PatchCache                128 /   131072
  FontRenderer 0 A8     1048576 /  1048576
  FontRenderer 0 RGBA         0 /        0
  FontRenderer 0 total  1048576 /  1048576
Other:
  FboCache                    0 /        0
Total memory usage:
  93243974 bytes, 88.92 MB

The total memory 88.92 MB is the sum of allocated memory for TextureCache + Layers total + ... + FboCache

This output goes from the Android HWUI library - which is implementation of Android UI drawing based on OpenGL HW accelerated library

More details could be read in the sources, for example here

N0dGrand87
  • 727
  • 1
  • 9
  • 16