I am writing code for a C ++ application foo.exe. Inside the application, I want to write its address space. So the performance counter that I want to pay attention to is "\ Process (foo) \ Virtual Bytes". The problem I am facing is that there may be multiple instances of foo.exe in the system. In perfmon, I see that they are referenced as "\ Process (foo # 2) \ Virtual Bytes", where # 2 can be any number depending on the number of processes.
How can I build a counter path to get virtual bytes for the current process that handles the case when there are multiple process instances?
source
share