Visual Studio diagnostic tools not displaying proc

2019-05-24 08:26发布

问题:

I have a VB.NET app (with C# libraries) which is consuming large amounts of memory over time. Ultimately the application runs out of memory. I am cautious about using the term leaking because the GC shouldn't allow a memory leak, but perhaps there is a large .NET object somewhere. If so I need to identify it.

However I do have a reference to a 3rd party ActiveX control library (.ocx) of which I use some controls and make numerous calls retrieving laser beam profile data. Memory usage increases only when I run a loop retrieving the laser beam profile data from the ocx. I suspect the ocx but need to know for sure before contacting the vendor.

I debugged my application in Visual Studio 2017, Diagnostic Tools with Memory Tools enabled, and option Memory Enable native heap profiling with snapshots enabled.

My issue is I don't see the massive amount of memory in the graph at all in the Memory Usage tab of diagnostic tools. After 30 minutes my application is at around 2GB and being an x86 application, this is a problem - regardless of cpu architecture really. Maybe I'm looking at the wrong thing.

So what am I doing wrong to find the memory issue? How can I find the offending objects?

Update 1

I ran the Performance Profiler and did not see any increase in memory as seen with diagnostic tools. Task manager also confirms that no memory leak is present when running with Performance Profiling. Running without profiling afterwards shows a memory leak again.