Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8949133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:10:08+00:00 2026-06-15T13:10:08+00:00

So I have a .NET Windows Store app that is leaking memory. What can

  • 0

So I have a .NET Windows Store app that is leaking memory. What can I do about it? The profiler tools I used for desktop apps from jetBrains or Red-Gate/ANTS don’t support Metro Apps (or do they now?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:10:10+00:00Added an answer on June 15, 2026 at 1:10 pm

    For the simplest approach – skip to the bottom to read about the description of doing that with Visual Studio 2013.


    Now there might be some new tools – perhaps something in the updated Visual Studio and I would love to find about these, but I tried WinDbg before with some success. Here are my old notes on how to do that:

    1. Create dump file from process manager
    2. Run WinDbg (X64)
    3. File/Open Crash Dump… (Crtl+D)
    4. Run following:
    
    lm
    .load C:\windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll
    .sympath SRV*c:\localsymbols*http://msdl.microsoft.com/download/symbols
    .symfix
    .reload
    !dumpheap -stat
    

    Note that if your process if x86, especially if you are running on a x64 version of Windows – you will need to use an x86 version of the debugger (WinDbg ships both versions) to save the dump. SOS, which is a managed memory debugging extension for WinDbg does not support debugging x64 bit dumps of x86 bit processes. You will then also need to update the sos path respectively, so it looks like this:

    .load C:\windows\Microsoft.NET\Framework\v4.0.30319\sos.dll
    

    Possibly not all of these commands are necessary, but this is what worked for me.

    Now you can find the type of the object that seems to exist in too many instances

    !DumpHeap -type TypeName
    

    where type name is just the name of the type – no fully qualified namespace necessary.

    Now you can check what keeps this object in memory:

    !GCRoot Object_Address
    

    Live debugging didn’t work for me since the app seems to get suspended when you attach a debugger. I think I saw an option somewhere to make the app stay in memory, but I forgot where, but for memory profiling – looking at a static dump file might be enough.


    You can download WinDbg as part of Windows SDK or as a standalone download of “Debugging Tools for Windows” from here.

    To create a dump file – go to Task Manager, right click a proces and select “Create dump file”.


    Some more links:

    http://blogs.microsoft.co.il/blogs/sasha/archive/2012/10/15/diagnosing-memory-leaks-in-managed-windows-store-apps.aspx

    http://blogs.msdn.com/b/delay/archive/2009/03/11/where-s-your-leak-at-using-windbg-sos-and-gcroot-to-diagnose-a-net-memory-leak.aspx

    http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/f3a3faa3-f1b3-4348-944c-43f11c339423

    http://msdn.microsoft.com/en-us/library/bb190764.aspx

    http://blogs.msdn.com/b/dougste/archive/2009/02/18/failed-to-load-data-access-dll-0x80004005-or-what-is-mscordacwks-dll.aspx


    *EDIT

    According to .NET Memory Allocation Profiling with Visual Studio 2012 by Stephen Toub – PerfView tool supports analyzing leaks in .NET Windows Store apps. Check an article and video walkthrough with Vance Morrison here.


    *EDIT 2

    Visual Studio 2013 Preview adds a new option to analyze managed memory heaps from dump files. To do it – simply pause your app in the Visual Studio debugger, save your current dump through Debug/Save Dump As, then resume execution and use your app until your suspected leak happens and do another dump. Then go to File/Open/File and open the second dump file. To the right of the Dump Summary in the “Actions” panel you’ll see a “Debug Managed Memory” action. Select that and then in “Select Baseline” select your first dump file. You will see a list of objects on the managed heap, grouped by type, with count diffs. Note that you would typically first look at the objects with low, non-zero count differences to track a single leak source. You can drill into the list of objects and see what keeps them in memory by expanding the tree in the Reference Graph view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Windows.Forms based .NET desktop application that stores privileged information in a
JI have written a .NET C# Windows Form app in Visual Studio 2008 that
We have an MSI installer for a .Net WinForms app for Windows XP that
I have a .NET Windows service and a .NET Web Application that I would
I have a VB.NET Windows Service that I wrote and it works fine. In
We have a .NET 2.0 winforms app that connects to a SQL Server 2005
When developing a .NET Windows Forms Application we have the choice between those App.config
I am developing a .NET 3.5 Windows Forms app. I have two projects, the
I have create a Windows Store app which successfully updates its tile (live tile).
I have a windows app written in C# (.net 3.5), and have a Settings.settings

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.