Troubleshooting native memory leaks in Windows Store applications using DebugDiag and LeakTrack

1.5k views Asked by At

The scenario is pretty simple:

I have a memory leak in a Windows Store App, identified as native after using dotMemory profiler. Since this tool is limited to analyzing managed memory I did further research by performing a memory dump analysis using DebugDiag. This got me one step further and I could find that the increasing memory is committed to a heap used by mscoreei (anyone has additional info about this dll? A simple google search does not return much)

DebugDiag also has a nice feature called Memory Leak analysis witch injects the LeakTrack.dll into a running process to collect information about memory allocation, which in turn potentially can help identify which parts of managed code use the native leaking resource. However, I am getting an error when I try use this on my Windows Store App

"Failed to monitor for leaks in process .... Please make sure that everyone has read and execute permissions for ...\LeakTrack.dll".

I did modify the permissions to that file so everyone has full access, but still the same error.

My questions are:

How can I use LeakTrack on a Windows Store Apps?

What is the the best/alternative approach to perform native memory leaks in Windows Store Apps?

1

There are 1 answers

0
Bob Kline On

We solved this by giving the currently logged on user (actually the group to which he belonged) the 'Debug Programs' permission.

Here are instructions on how to do this:

To access the local group policy:

  1. From the Start menu, choose Control Panel.
  2. In Control Panel, double-click Administrative Tools.
  3. In the Administrative Tools window, double-click Local Security Policy.
  4. In the Local Security Settings window, expand the Local Policies folder.
  5. Click User Rights Assignment.
  6. In the Policy column, double-click Debug programs to view current local group policy assignments in the Local Security Policy Setting dialog box.
  7. To add new users, click the Add User or Group button.