[android-developers] Re: Any way to avoid garbage collection on these lines? Bitmap.createBitmap / new Canvas(bitmap)

2009-04-14 Thread Streets Of Boston
In one of my apps i have similar concerns. I cache a bunch of bitmaps to improve the user experience (using Map). However, at some point in my app, the app needs the memory (preparing for image-editing on full- sized image). This is what i did: I wrote a class to which bitmap-caches can register

[android-developers] Re: Any way to avoid garbage collection on these lines? Bitmap.createBitmap / new Canvas(bitmap)

2009-04-14 Thread Mark Murphy
> I'm happy to keep a static or member reference to the Bitmap object > for future usage - but I'm worried if that will reduce the amount of > memory available to my app? You wrote: "Running these many times in my app loop" To me, the key word there is "many". If really do mean "many", then cac

[android-developers] Re: Any way to avoid garbage collection on these lines? Bitmap.createBitmap / new Canvas(bitmap)

2009-04-14 Thread admin.androidsl...@googlemail.com
I'm happy to keep a static or member reference to the Bitmap object for future usage - but I'm worried if that will reduce the amount of memory available to my app? Alex On Apr 14, 2:51 pm, Streets Of Boston wrote: > If this bitmap is used for displaying only one item (image), why do > you cre

[android-developers] Re: Any way to avoid garbage collection on these lines? Bitmap.createBitmap / new Canvas(bitmap)

2009-04-14 Thread Streets Of Boston
If this bitmap is used for displaying only one item (image), why do you create a new bitmap over and over again? once: mBitmap = Bitmap.createBitmap(320,480,Config.RGB_565); ... ... many times: Canvas canvas = new Canvas(mBitmap); // clear canvas // draw into canvas ... .. On Apr 14, 9:22 am, "a