locked
How to reduce used memory for images RRS feed

  • Question

  • I have ListBox with ~90 images. Every image has size = ~40Kb. Why application take 120Mb in memory?
    How can i reduce using of memory?

    P.S. all images is png 8. I can't load images on demand.
    Monday, April 11, 2011 3:03 PM

Answers

  • The problem has been solved by replacing StackPanel with VirtualizingStackPanel.
    Wednesday, April 13, 2011 6:13 PM

All replies

  • I'm facing the same issue. Also this memory doesn't go off if we navigate away from the page.
    Monday, April 11, 2011 3:26 PM
  • Take a look at this post on my blog:
    http://blogs.msdn.com/b/swick/archive/2011/04/07/image-tips-for-windows-phone-7.aspx

    Specifically, the part about "Image Caching", but the also the "Custom Decoding" section might help. I actually have a follow-up post in the works that highlights these two features specifically in the light of reducing memory. Just cleaning up my sample a little and will post it there shortly.

    Thanks,
    Stefan Wick - Microsoft Silverlight
    Monday, April 11, 2011 3:42 PM
  • The problem has been solved by replacing StackPanel with VirtualizingStackPanel.
    Wednesday, April 13, 2011 6:13 PM
  • Out of curiosity, can I ask you how much memory does the app take now with the VirtualizingStackPanel, considering the same scenario with ~90 images, each ~40KB in size and all png 8?

    Thanks!
    ~raffaele
    Thursday, April 14, 2011 9:29 AM