I created two (as basic as you can get) .XAML pages.
StaticPage.xaml
- Shows memory usage
- Links to MemoryTest.xaml
MemoryTest.xaml
- Does nothing but displays 10 or so Text Blocks each wiht Text="This is some text".
PROBLEM
If all you do is navigate back and forth between the pages using a hyperlink, and then the hardware backbutton, memory usage looks good. but if you keep doing it over and over... BOTH the current memory usage, and the Total Memory usage climbs !!!!! all the way past the 90MB limit.
View my screenshot here:
SideNotes:
Faster navigation or slower does not make a difference. There are no resources to release, no thing to do in code behind becuase there is nothing there... Now if you add more controls (as a normal app would, this process increases faster). Adding more static text blocks also increases the speed the 90MB limit is reached.
This is bad becuase I have a photoalbum page that uses memory that is not getting released and after 5 min or decent usage, it goes over 90MB.. I need to try and get this resolved so it doesnt fail the marketplace test.
Here is the code behind for each Page
StaticPage.xaml
public partial class staticPage : PhoneApplicationPage
{
public staticPage()
{
InitializeComponent();
}
private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/TestDir/MemTest.xaml", UriKind.Relative));
txtMem.Text = String.Format("{0} MB Peak\n{1} MB Current", (DeviceStatus.ApplicationPeakMemoryUsage / 1048576).ToString(), (DeviceStatus.ApplicationCurrentMemoryUsage / 1048576).ToString());
}
}
MemoryTest.xaml
public partial class MemTest : PhoneApplicationPage
{
public MemTest()
{
InitializeComponent();
}
}