问题
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:
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:
- From the Start menu, choose Control Panel.
- In Control Panel, double-click Administrative Tools.
- In the Administrative Tools window, double-click Local Security Policy.
- In the Local Security Settings window, expand the Local Policies folder.
- Click User Rights Assignment.
- In the Policy column, double-click Debug programs to view current local group policy assignments in the Local Security Policy Setting dialog box.
- To add new users, click the Add User or Group button.
来源:https://stackoverflow.com/questions/21462880/troubleshooting-native-memory-leaks-in-windows-store-applications-using-debugdia