I have a problem in my application and I do not know if this is normal or not. I have a text block in my application that should display a large amount of text (2000-4000 characters). Anyway, there is a limit of 2048 pixels, I think my text is cropped, this is not a problem, I use this: http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating- scrollable-textblock-for-wp7.aspx .
The problem is that the longer the text, the more memory it consumes. Without a very long text hack with the link above, the text block consumes about 10 MB of memory! If I use ScrollableTextBlock from the link above, the amount of memory will be even larger and reach 30-40 mb. No limit. So it seems that memory usage is related to the allocated area ...
Is there a way to reduce memory usage for long texts? Does BitmapCach have anything related to this problem, and can I disable it? You can easily reproduce this problem by simply adding a text block with very long text, and you can check the memory usage with this code, you will see that with one text block with long text, the peak memory increases by 10 mb or more:
long deviceTotalMemory = (long)DeviceExtendedProperties.GetValue("DeviceTotalMemory"); long applicationCurrentMemoryUsage = (long)DeviceExtendedProperties.GetValue("ApplicationCurrentMemoryUsage"); long applicationPeakMemoryUsage = (long)DeviceExtendedProperties.GetValue("ApplicationPeakMemoryUsage"); Debug.WriteLine("### deviceTotalMemory : " + deviceTotalMemory); Debug.WriteLine("### applicationCurrentMemoryUsage : " + applicationCurrentMemoryUsage); Debug.WriteLine("### applicationPeakMemoryUsage : " + applicationPeakMemoryUsage);
source share