Getting a list of static objects.

  • Thread starter Thread starter Peter Strøiman
  • Start date Start date
P

Peter Strøiman

Hi.

I have a test application that loads some data from a database. This process
is then iterated a number of times, and the memory consumption of the
application is rapidly rising.
Since the garbage collection is running, it must be because some static or
stack variable is holding a reference ( I use static variables heavily for
caching data ).

Is there a way to get a list of static and stack objects?

Thanks in advance,
Peter Strøiman
 
Peter:

You can get a list of statics via using the System.Reflection namespace.
If you want to monitor garbage collection, look into the CLR profiling
functions.

John
 
Back
Top