Count Objects in your application

Posted by Neeks under ASP.NET on 7/17/2009 | Views : 1984 | Status : [Member] | Replies : 3
Hi Friends,
I am doing application which counts total number object created, total number of destroyed object and total number of remaining objects.
How is it possible in asp.net using C#.Net or VB.Net .

Hope you all got my point.....

Thanks in Advance.




Responses

Posted by: Vuyiswamb on: 7/19/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning Neeks

That is a Cool, Because this will remind a programmer to dispose the object that are not needed anymore. This is a Simple one and a Good practise. now this means when you create an object you need to add 1 to a Counter variable , and if you dispose one in the Finally block you need to subject the Count the of the objects.

Simple ne :)

Thank you for Posting at Dotnetfunda


Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Neeks, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeks on: 7/19/2009 [Member] Bronze

Up
0
Down
Thanks Vuyiswamb for your reply.
I want to know is there any other way using Garbage Collection?


Without the counter variable for the objects...

Keep smiling and coading...

Neeks, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 7/20/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Neeks look at the Following Articles

http://msdn.microsoft.com/en-us/magazine/bb985011.aspx


But i prefare that Garbage Collector be left alone, i cannot advise anyone to access the heaps on the GC. but check the Article.

Thank you for Posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Neeks, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response