Howto monitor object creations
jaap.q42
Posts: 36 Bronze 2
I'm using the memoryprofiler to track down memleaks we've been experiencing. I've pinpointed the type of object that is being held into memory.
We're using Lucene which does a lot of internal caching.
Can I use Memory profiler to see at what time an object is created?
I know the CLR Profiler claims to be able to provide this info:
"Which methods allocate which types of objects?"
But I can't get the CLR profiler to work, and there's no chance of any support on that tool.
Hope someone can help me!
Jaap Taal
We're using Lucene which does a lot of internal caching.
Can I use Memory profiler to see at what time an object is created?
I know the CLR Profiler claims to be able to provide this info:
"Which methods allocate which types of objects?"
But I can't get the CLR profiler to work, and there's no chance of any support on that tool.
Hope someone can help me!
Jaap Taal
Comments
the simple answer is "no" (sorry) but I think you can set Visual Studio to break on the constructor of this object (using "break on function" feature)?
I'm using Visual Web Developer 2008. I couldn't find how to run a debugger and the memory profiler at the same time. Do you know whether it's possible?
Also, you may sometimes want to profile a class which in located in de System namespace. How would you set trigger a break point then?
"Off topic":
So maybe a new feature in ANTS Memory Profiler 6 could be that you can navigate from an instance in the instance list back to the reference graph, filtering just 1 object.
From my point of view this should be possible since the Profiler already filters objects, why not allow a single-object filter which can be activated from the instance list!
Anyway, I might be saying something that's technically not possible, or maybe nobody else is interested in such a feature...
Jaap
Sure- I would use WinDbg and attach it to your process (run under ANTS). But I don't think there is any necessity to run them simulatneously. Profiling and debugging can always be successfully done serially I would say.
To access System code, you may wish to check out Reflector PRO:
Download here:
http://downloads.red-gate.com/EAP/Refle ... Deploy.zip
I'm sorry- I don't understand this feature