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
"Kevin Yu [MSFT]" <v-****@online.mic rosoft.com> wrote in message
news:lc******** ******@TK2MSFTN GXA01.phx.gbl.. .
Thanks for NuTcAsE's quick response!
Hi Don,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you would like to get all instantiated
objects in the application. If there is any misunderstandin g, please feel
free to let me know.
As far as I know, the current .NET framework didn't expose this kind of
method to us, which means we cannot get that in our applications. I think
the only way for us to achieve that is to use performance counters as
NuTcAsE mentioned.
HTH.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."