Visual Studio 2015, Diagnostic tools, Memory Usage: What is [Self] ?

Category: visual studio diagnostics

Question

EtienneUF on Wed, 10 Jan 2018 10:11:26


Hi,

In Visual Studio's Diagnostic tools, Memory Usage, I attach to my running process (a service, Native C++) and take a snapshot. Looking at it I see in the Heap tree an item called [Self] under [External Frame], and a few functions I know. Those functions don't show a lot of memory allocations, but [Self] does. It seems [Self] is leaking massively.

Those functions have a little arrow on which I can click to go down and see the stack trace of the allocations. But [Self] does not have such an arrow.

I have no clue what [Self] is or what could be causing these apparent leaks, I am not even sure these are 'real' leaks.

So my question is: how can I investigate these allocations under [Self], and what is [Self] anyway ?

Thanks,

Etienne

Replies

Fletch Zhou on Thu, 11 Jan 2018 08:30:27


>>I attach to my running process (a service, Native C++) and take a snapshot. Looking at it I see in the Heap tree an item called [Self] under [External Frame]

Not pretty sure what [self] is, but it seems the [self] is in your attached process[a service, Native C++]

However Native Memory Diagnostics in VS2015 does not support it:

Which is mentioned at the bottom of this reference link: https://blogs.msdn.microsoft.com/vcblog/2014/11/21/native-memory-diagnostics-in-vs2015-preview/

 

Regards,

Fletcher


MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


EtienneUF on Thu, 11 Jan 2018 09:27:18


Thanks for your answer...

Interesting that Attach to process isn't supported, it does appear to work correctly.
Except for the illusive [Self]. Would [Self] have anything to do with something that is unsupported in my scenario?

Without Attach to process, how else can I use the diagnostic tools on a Service?
On a normal program that's easy, but how to do that on a service, if not with attach to process?

Thanks,
Etienne

Fletch Zhou on Fri, 12 Jan 2018 07:59:31


>>Without Attach to process, how else can I use the diagnostic tools on a Service?

May I know if the Service is built by Visual studio?

 

Regards,

Fletcher


MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


EtienneUF on Fri, 12 Jan 2018 08:20:52


It is build with the Visual C++ compiler and nmake, but outside of Visual Studio.

Thanks,
Etienne

Fletch Zhou on Mon, 15 Jan 2018 02:28:59


I assume the unresolved frames [unknown]. This is because Visual Studio needs symbol files in order to resolve call stacks from system assemblies. You can enable Microsoft Symbol Servers from Tools -> Options -> Debugging -> Symbols. If you have a session file opened, you will need to save and reopen the file for the changes to take effect. For [self] item here, I’m not pretty sure, but you could give it try.

 

Regards,

Fletcher


MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


EtienneUF on Mon, 15 Jan 2018 14:07:59


I am beginning to suspect that [Self] means everything, i.e. the total memory the whole process is consuming, both as a result of allocations made by the program itself and of allocations made by Windows on behalf of the process. But I still don't know for sure...

Unresolved frames, assemblies... this is a native C++ program, not .NET, I don't think these things are applicable to native programs.

Thanks anyway,
Etienne

Fletch Zhou on Tue, 16 Jan 2018 08:48:29


Sorry we still haven't figured it out what the [self] is, since VS  cannot analyze it.

I'll keep this thread open to see if other members who have this similar issue.

Your understanding and cooperation will be grateful.

 

Regards,

Fletcher


MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


EtienneUF on Tue, 16 Jan 2018 15:37:20


Ok, thanks.

Regards,
Etienne