how to find ram usage for graphics susbsystem

1,071 views
Skip to first unread message

srikgn

unread,
Nov 28, 2011, 8:26:05 PM11/28/11
to android-platform
I am trying to find out the run time memory allocated for Graphics
subsystem on a android device leaving bitpmaps and resources aside.

I understand that Below factors contribute to RAM of a Android device
keeping Graphics subsystem in mind


a) Views
b) Caching[Texture cache, gradient cache etc and optimisation [ GPU
rendering / 2D hw pipeline
c) Surfaces
d) Memroy allocated by Graphics vendor like 3d graphics and openGl
operations.


To determine this,i took help of Android dumpstate log which gives
librank,procrank output and gfx service logs.


1) PSS total of below excerpts from librank


92671K /dev/pvrsrvkm
715K /system/lib/libskia.so
359K /system/vendor/lib/egl/
libGLESv1******.so
343K /system/vendor/lib/egl/
libGLESv2_
315K /system/lib/libEGL.so
251K /system/lib/libgui.so
227K /system/lib/libhwui.so
131K /system/lib/libui.so
103K /system/lib/egl/
libGLES_android.so
99K /system/vendor/lib/
libIMGegl.so
88K /system/lib/
libsurfaceflinger.so
87K /system/lib/
libpixelflinger.so
3K /dev/ashmem/SurfaceFlinger


2)


and


Adding caches size printed of all the apps under GFXService dump


Example , launcher app shows...below details
Caches:
Current memory usage / total memory usage (bytes):
TextureCache 2559640 / 25165824
LayerCache 1703936 / 16777216
GradientCache 0 / 524288
...................
........................
....................
Total memory usage:
2670600 bytes, 2.55 MB


Quesitons:


1) By adding 1 + 2 i conclude that i have got memory occupied in
RAM
because of Entire Graphics subsystem ?
2) What kind of mem allcoatins go into /dev/pvrsrvkm and /dev/ashmem/
SurfaceFlinger
3) is there any other better method to calculate


Kindly answer this question as soon as possible

Dianne Hackborn

unread,
Nov 30, 2011, 3:37:28 PM11/30/11
to android-...@googlegroups.com
This is a huge complicated area you are getting in to, and there is no simple answer for you.

The most accurate view of how much memory a process is using is "and shell dumpsys meminfo".  However this can't supply detailed information.  It will show you pss of the dalvik heap, the native heap, and some select other types of allocations.  How you find the allocations for the OpenGL driver varies on the manufacturer -- in your case you are using the same PVR hardware as Nexus S and Galaxy Nexus, so the internal driver allocations generally appear under "Other dev".

I don't think you want to use librank, that organizes allocations in a way that would make it very hard to understand a single process.

You can use "showmap <pid>" to see the maps for a particular process.  Note that you need to have a good understanding of how Linux works to start to interpret that data.  For example when you see lines for specific libraries, this is probably pages of code that are currently mapped to RAM for that library.  It has nothing to do with allocations in those libraries.

I think you probably need to ask more specific questions about what you want to get useful answers.


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.




--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Reply all
Reply to author
Forward
0 new messages