Eric Z
Eric Z

Reputation: 14535

Remote memory profiling w/ Visual Studio

Is there a way to profile memory of a native C++ application on a remote machine where VS is not installed?

Per MSFT document below, remote tool is installed on the remote Windows and VSDiagnostics.exe should be used. There are also two relevant agent DLLs (MemoryProfilerCollectionAgent and NativeMemoryCollectionAgent). However, there are no sample agent config JSON files for them.

And I don't seem to find any page that introduces these two agents. So hence to ask:

VSDiagnostics.exe start <id> /attach:<pid> /loadConfig:<configFile>

enter image description here

enter image description here

enter image description here

Upvotes: 0

Views: 206

Answers (1)

Cody Liang
Cody Liang

Reputation: 1191

Regarding the questions you raised, please refer to the following suggestions:

1: Memory analysis can be supported remotely by using VSDiagnostics.exe.

2: Regarding the CLSID of the agent, you can usually find it in the registry. You can check the InProcServer32 key under the HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\ or HKEY_CLASSES_ROOT\CLSID\ path, where the DLL files associated with the CLSID are usually listed. If you know the name of the broker, you can try searching the registry for the corresponding CLSID. Regarding this issue, there is a similar post for reference: How to find a DLL given a CLSID?

3: Regarding how to create the configuration file, just create it in the same format as the third picture you uploaded.

4: Once you have the configuration file, you can use the following command to start VSDiagnostics.exe and attach to the remote process: VSDiagnostics.exe start /attach: /loadConfig:

Upvotes: 1

Related Questions