Re-using Bitmaps (100 Days of Google Dev)
In modern mobile applications, Bitmaps can account for a large amount of memory churn. Constantly loading thumbnails, user icons, and Emoji sets can provide your users with a steady stream of media, but it can also contribute to some HUGE pauses for garbage collection.
In this video Colt McAnlis, and for temporally allocated bitmaps, there’s a handy trick that you absolutely should be using to escape these performance problems: Re-using bitmaps.
Every time you allocate a bitmap, you have to incur some overhead to allocate the objects from the heap, which is less than ideal if you’ve got a lot of bitmaps. Rather than banging on the heap for new objects each time, you can instead, reuse the memory that an existing bitmap has created, and load your image there.
The end result? Less memory churn from bitmaps.
Watch more Android Performance Patterns here:
100 Days of Google Dev / 100 developer videos over 100 days / #GoogleDev100
Join the G+ Community here:
Subscribe to the Google Developers channel here:
In this video Colt McAnlis, and for temporally allocated bitmaps, there’s a handy trick that you absolutely should be using to escape these performance problems: Re-using bitmaps.
Every time you allocate a bitmap, you have to incur some overhead to allocate the objects from the heap, which is less than ideal if you’ve got a lot of bitmaps. Rather than banging on the heap for new objects each time, you can instead, reuse the memory that an existing bitmap has created, and load your image there.
The end result? Less memory churn from bitmaps.
Watch more Android Performance Patterns here:
100 Days of Google Dev / 100 developer videos over 100 days / #GoogleDev100
Join the G+ Community here:
Subscribe to the Google Developers channel here:
Rcreviews.lt is not the owner of this text/video/image/photo content, the real source of content is Youtube.com and user declared in this page publication as Youtube.com user,
if you have any question about video removal, what was shared by open community, please contact Youtube.com directly or report bad/not working video links directly to video owner on Youtube.com. Removed video from Youtube.com will also be removed from here.
Watch more videos
-
#Shorts massive servo wire attack
About 200 packs and 1000 servo leads in free fall For many many many planes to build! #shorts ... -
DLG - FLITZ - soaring joy!
The joy of DLG soaring! Pilot and Wing owner - Andrius Narbutas Bright LED: / - More products ... -
HEE Wing F-01 Ultra Delta Wing 690mm - upgraded Mini AR Wing? Diatone Reaper 690
Heee Wiiiinggggg - an 690mm triangle wing, with big battery bay, and up to 220 km/h speeds! Easy...

Advertising