473,511 Members | 15,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Count of objects instantiated?

Is there any function in the CLR that can give me a count, by type, of
the number of objects currently instantiated?
--
Philip Daniels
Aug 30 '06 #1
3 1153
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.

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...
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Aug 30 '06 #2
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
Aug 30 '06 #3
Hello, Philip!

PDHad a quick look, and ICorProfilerCallback::ObjectsAllocatedByClass
PDlooks handy. Basically what I would be interested in is tracking
PDobject allocations and garbage collections over time to see if there
PDare any object leaks. Not sure if it can do the garbage collections
PDpart of that though...

ClrProfiler is doing that. Source code of ClrProfiler is available, you can
dig in there and try to find out how it tracks gc collecitons...

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Aug 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2224
by: phil | last post by:
Using Tkinter Canvas to teach High School Geometry with A LOT of success. My drawing gets very slow after a lot of actions. For instance I have created code to rotate a set of objects about a...
6
3137
by: Don Stewart | last post by:
From within a .NET 1.1 application and using C# Code, I need to get a list of all the instatiated objects in the application, with the following columns: TypeName, Instatiation-Count, Size...
2
2258
by: FredC | last post by:
S Name Microsoft Windows XP Professional Version 5.1.2600 Service Pack 2 Build 2600 Total Physical Memory 1,024.00 MB MDE 2003 Version 7.1.3008 ..NET Framework 1.1 Version 1.1.4322 SP1...
6
1567
by: Mariano | last post by:
Hi, I have stored a menu in a database. The menu is dynamically updated and last level menu items contain the object type that should be instantiated. I am looking for a way to instantiate the...
3
1976
by: Miguel | last post by:
Hi, I'm new to .NET and am using VB .NET as I am from a VB background. I am having difficulty understanding the way .NET handles, passes and uses objects. I have had a look at the Micrsoft Data...
8
1843
by: Lüpher Cypher | last post by:
Hi, Suppose we have a hierarchical class structure that looks something like this: Object | +-- Main | +-- Object1
1
1140
by: Thom Anderson | last post by:
Hi, I have some business objects that are pretty simple. They get instantiated and have a few properties, methods, and events. The business objects talk to the database directly or access web...
9
3790
by: Simon Woods | last post by:
Hi I have a factory class which I want to use to create new objects which inherit a certain base type so I have a declaration Public Class MyOwnFactory(Of T As MyOwnBase) As I understand...
9
2969
by: smarttechie | last post by:
Hii all please help its urgent i have developed an application in xsl. what i want to do is i m searching the xml file based on a search.and based on that search im creating one tree like...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.