title: What could cause this memory issue?
body: <p>I'm working on an app for windows phone 8, and I'm having a memory leak problem.  But first some background.  The app works (unfortunately) using WebBrowsers as pages. The pages are pretty complex with a lot of javascript involved.</p>
  
  <p>The native part of the app, written in c#, is responsible for doing some simple communication with the javascript(e.g. native is a delegate for the javascript to communicate with a server), make animation for page transition, tracking, persistance, etc.  All is done in a unique PhoneApplicationPage.</p>
  
  <p>After I had some crashes for out of memory exceptions, I started profiling the app.  I can see that the WebBrowsers, which are the big part of the the app, are being disposed correctly.
  But the problem I'm seeing is that memory continues to increase. What's worse, I have little feedback from the profiler.  From what I understand, the profiler graph says there is a big problem, while the profiler numbers say there's no problem at all...</p>
  
  <p>Note: the step represents a navigation from a WebBrowser to another WebBrowser.  The spike is created (I suppose) by the animation between the two controls.  In the span I've selected in the image, I was doing a navigation forward and one backward having a maxium of 5 WebBrowsers (2 for menus that are always there, 1 for the index page, 1 for the page I navigate from and 1 for the page I navigate to).  At every navigation the profiler shows the correct number of WebBrowsers: 5 after navigating forward, 4 after navigating backward.</p>
  
  <p>Note 2: I have added the red line to make clearer that the memory is going up in that span of time</p>
  
  <p>As you can see from the image 
  <img src="https://i.stack.imgur.com/MxrrC.jpg" alt="profiler">
  the memory usage is pretty big but the numbers say it's low and in that span of time, retained allocation is lower than when it started...</p>
  
  <p>I hope I've included enough information.  I want some ideas on what could cause this problem.  My ideas so far are:</p>
  
  <p>-the javascript in the WebBrowser is doing something wrong (e.g. not cleaning some event handler).  Even if this is the case, shouldn't the WebBrowser release the memory when it is destroyed?</p>
  
  <p>-using a unique PhoneApplicationPage is something evil that is not supposed to be done, and changing its structure may cause this.</p>
  
  <p>-other?</p>
  
  <p>Another question: why does the graph show the correct amount of memory use while the number doesn't?</p>
  
  <p>If you need more info about the profiler, ask and I will post them tomorrow.</p>