locked
how to solve problem of memory is in-sufficient when i use WiteableBitmap ?

Answers

  • I'd re-think your design. 

    Are you displaying 5000 marker images on one screen at once?  If not, only render the images that you're intending to display.

    -or-

    Cache the images to files in isolated storage and then let the virtualising panels (whatever is displaying your markers) load and unload them as needed.


    Darin R.

    Monday, March 31, 2014 3:44 PM

All replies

  • Can you provide more details and possibly some code?

    http://rbrundritt.wordpress.com

    Wednesday, March 26, 2014 10:57 AM
  • WriteableBitmap wb = new WriteableBitmap(cacheItem.writeableBitmap.PixelWidth, cacheItem.writeableBitmap.PixelHeight);
                                    using (Stream stream = wb.PixelBuffer.AsStream())
                                    {
                                        if (stream.CanWrite)
                                        {
                                            await stream.WriteAsync(updatedPixelsArray, 0, updatedPixelsArray.Length);
                                            stream.Flush();

                                            markerImage.Source = wb;
                                        }
                                        stream.Dispose();
                                    }

                                    wb.Invalidate();

    where,

        updatedPixelsArray is byte array.

    so, i need to create WiteableBitmap    5000 times in Loop and it give me error as In-sufficient memory in writeableBitmap.

    Thursday, March 27, 2014 4:12 AM
  • Ok, by the sounds of it you are just creating too many images and using up all your memory. Since this post has nothing to do with Bing Maps I'm going to move it to the Windows store apps forums.

    http://rbrundritt.wordpress.com

    Thursday, March 27, 2014 11:15 AM
  • Are you updating a single marker image, or are you updating 5000 marker images?

    How big is writableBitmap.PixelWidth & PixelHeight?


    Darin R.

    Friday, March 28, 2014 6:06 PM
  •  i updating 5000 marker images and pixels width=640 and pixels height=480
    Monday, March 31, 2014 5:15 AM
  • I'd re-think your design. 

    Are you displaying 5000 marker images on one screen at once?  If not, only render the images that you're intending to display.

    -or-

    Cache the images to files in isolated storage and then let the virtualising panels (whatever is displaying your markers) load and unload them as needed.


    Darin R.

    Monday, March 31, 2014 3:44 PM
  • please give me some sample code for load 5000 marker with writeable bitmap.
    Friday, April 11, 2014 4:10 AM