Our software has many hundreds of classes and forms
throughout the entire solution. Due to recent Out-of-Memory
and GDI+ Drawing errors and with some manual searching,
I have discovered that there are several classes that were
NOT being Disposed.
We have a fantastic Error-Reporting mechanism
that sends loads of useful information. I want to add a list of
Types that have more than X number of instantiations to these
reports.
There are several reasons that prevent counting each class as
it gets instantiated. Also I really need to see what is actually
going on, even at the System level like Strings.
I have started to look at the Performance Counters to see
if I could find what I'm looking for. I also have found a couple
of API Functions that Get the heap, but this seems somewhat
complicated and warns that it could slow the performance of the
program until it is closed. I may end up using this method
anyways, because it is already throwing errors, and I might as
well get useful debugging info.
PS:
As a side note, I am kinda upset with how the CLR and GC
Dies when it reaches a certain level instead of consuming more
memory. This was obvious during a situation recently where:
on a Server with Dual XEON 3GHz with 4GB of Ram
and "ONLY 1 USER" Logged in! Our application crashed
from Out-Of-Memory errors while using only 301MB of
System Memory. Basically our App only shows Windows
Forms and Controls with not very much behind the scenes
data in Memory. The only applications is installed on the
System was Windows 2000 Server, Citrix and our application.
Thanks for your help.
Don
"Evan Mathias" <evanmathias@hotmail.com> wrote in message
news:%23bVkLM3DFHA.3368@TK2MSFTNGP10.phx.gbl...[color=blue]
> Odd question. The garbage collector is a pretty complex system, and while
> there are ways to force it to delete objects, there is no way to guarantee
> an object has been deleted. In essence tracking instantiated objects will
> involve tracking the garbage collector, which just can't be useful, unless
> you are trying to understand how it works. You may need to review what it
> is you are trying to do.
>
>
> "Don Stewart" <don@encite.us> wrote in message
> news:110kncahh2ag439@corp.supernews.com...[color=green]
>> 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
>>
>> I was thinking of using the Garbage Collector somehow or perhaps a Heap
>> and Stack Dump?
>> Using an external utility application is NOT an option.
>> Does anyone have any ideas?
>>
>> Thank you for any assistance.
>> Don Stewart
>>
don@encite.us
>>[/color]
>
>[/color]