Is the surfaceflinger in charge of allocating memory for bitmaps/ninepatches?

113 views
Skip to first unread message

Android007

unread,
Nov 1, 2012, 6:32:12 AM11/1/12
to android-...@googlegroups.com
Hi,
I noticed that when I am using a headless Android that can handle bitmaps (it should be able to do any type of work on bitmaps except displaying them), i am getting an OutOfMemory exception.
I suspect this is because gralloc is the one that allocats the memory for bitmaps (even if they don't appear on screen).
I don't have gralloc (removed the SurfaceFlinger). Could this be the cause for the OOM?

Is there any other way to allocate memory for bitmaps or does Android entirely rely on the existence of a SurfaceFlinger to do so?

I hope my question was  clear enough.

Romain Guy

unread,
Nov 1, 2012, 12:22:55 PM11/1/12
to android-...@googlegroups.com

Gralloc is not involved when creating bitmaps (at this time.)

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/lSh7n3ffDMYJ.
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.

Android007

unread,
Nov 4, 2012, 5:04:16 AM11/4/12
to android-...@googlegroups.com
Does this mean that Gralloc is only used when printing out to the screen? or is there any other usage?
If I don't want the OS to write anything to the screen (I want everything to be saved in my own Java struct), will I still nee the Gralloc module?

Android007

unread,
Nov 4, 2012, 5:29:56 AM11/4/12
to android-...@googlegroups.com
Whenever I try to load a resource (after I removed the Surfaceflinger) I get an Out Of Memory exception from BitmapFactory.nativeDecodeAsset.
This had me thinking that Gralloc is also used when loading bitmaps from resources...
Reply all
Reply to author
Forward
0 new messages