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

拈花ヽ惹草 提交于 2019-12-11 16:48:12

问题


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:

  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.


来源:https://stackoverflow.com/questions/21462880/troubleshooting-native-memory-leaks-in-windows-store-applications-using-debugdia

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!