On Wed, 30 Aug 2006 15:43:25 +0300, "Vadym Stetsyak" <va*****@ukr.net>
wrote:
>Hello, Philip!
PDIs there any function in the CLR that can give me a count, by type, of
PDthe number of objects currently instantiated?
In order to know that - you'll have to use Profiling API.
Thanks, Vadym, that was quick.
Had a quick look, and ICorProfilerCallback::ObjectsAllocatedByClass
looks handy. Basically what I would be interested in is tracking
object allocations and garbage collections over time to see if there
are any object leaks. Not sure if it can do the garbage collections
part of that though...
>Look at for more details
( http://msdn.microsoft.com/msdnmag/issues/01/12/hood/ )
( http://www.blong.com/Conferences/DCo.../Profiling.htm )
Or if you want to know the instances number of your custom type, then
you can create objects factory, where necessary count tracking will be
implemented...
Yeah, done that in the past but it's too invasive for my liking.
--
Philip Daniels