Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows-Phone-7
I am having a horrible time with the automatic image caching by WP7 platform.
 
I made a very simple app (I mean real simple). They have 2 images already added in solution as content of pix dimension 1280 x 2000 Here is XAML
<Grid x:Name="LayoutRoot" removed="Transparent" ManipulationCompleted="ImageHolder_ManipulationCompleted">
        <Image x:Name="ImageHolder" />
        <TextBlock x:Name="MemoryUsage" />
</Grid>
My .cs
ImageHolder.Source = null;
      if (i % 2 == 0)
           ImageHolder.Source = new BitmapImage(new Uri("image002.jpg", UriKind.Relative));
      else
           ImageHolder.Source = new BitmapImage(new Uri("image001.jpg", UriKind.Relative));
            i++;
 
            MemoryUsage.Text = "Device Total Memory = " + (long)DeviceExtendedProperties.GetValue("DeviceTotalMemory") / (1024 * 1024)
                + "\nCurrent Memory Usage = " + (long)DeviceExtendedProperties.GetValue("ApplicationCurrentMemoryUsage") / (1024 * 1024)
                + "\nPeak Memory Usage = " + (long)DeviceExtendedProperties.GetValue("ApplicationPeakMemoryUsage") / (1024 * 1024);
Memory usage is very high is equal to the 2 images in raw bitmap size, though there should only be one such instance. Please help, I am in dire need.
Posted 16-Nov-12 22:58pm
Edited 16-Nov-12 23:00pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Gihan Liyanage 338
2 ChauhanAjay 180
3 Vinay Mistry 160
4 Sergey Alexandrovich Kryukov 153
0 Sergey Alexandrovich Kryukov 9,011
1 OriginalGriff 7,941
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 17 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100