locked
Memory Leaks in Windows Store App Project Templates RRS feed

  • Question

  • I am working on my first Windows Store App.  I am using the Split App project template and am experiencing memory leaks.  In researching the source of the leaks, I ended up creating a new Split App project,  This new project, without any modifications, is leaking memory.  Using PerfView, VMMap, and Task Manager I observed similar results for three scenarios:

    Scenario1 - Launch the app.

    Scenario2 - After launch, click on Group Title 1 and then the back button, repeated 10 time.

    Scenario3 - After launch, click on Group Title 1 and then the back button, repeated 20 time.

    Clearly these scenarios are not doing any real work, but total memory for Scenario 2 was ~25% greater than Scenario 1; Scenario 3 was ~50% greater than Scenario 1.

    As reported by VMMap, Private Data (Private memory that isn't classified as Heap, Managed Heap, or Stack) increased by 81% after Scenario 2 and 187% after Scenario 3.  Can  you help me understand what's happening here?

    Thanks in advance,

    Bob Shotwell

    Thursday, February 6, 2014 11:17 PM

All replies

  • What you describe sounds expected. .Net code is garbage collected, not deterministically managed, so memory will safely rise until there is memory pressure and garbage collection kicks off.
    Friday, February 7, 2014 2:01 AM
    Moderator
  • Thanks Rob,

    I don't think this is simply a garbage collection issue.  When I used PerfView to take memory heap snapshots, I used the "Force GC" option before each snapshot.

    Bob

    Friday, February 7, 2014 1:32 PM