Thursday, September 30, 2004

Circular References / Memory Leaks /other baddies

In a garbage collected environment such as .NET, it is possible to unwittingly leave objects in a state where the garbage man will be "on vacation". A good article at EggHeadcafe by Peter Bromberg. Also a related article in Ian Griffith's blog. Both these articles give a good insight to the GC and strongly referenced objects.

1 comment:

Anonymous said...

Hi ,
I am working in s/w company where i am working on vb.net.
We have developed one desktop application which is running 24*7 at client side.
We are running it by using scheduler. As it is running 24*7, it get crashed after 3 to 4 days.
And we came to know that it is bcoz of the memory leak in dotnet.
1)One of the cause we detected is, we are using dataset while filling the dataset using OledbDataAdapter, it creates DataColumn object implicitly. and the memory created for DataColumn is not getting freed.
2)Another thing is we are using ATL COM dll in Vb.net. and we are creating object of class in that COM dll by using "new" operator.
but we are not sure that the memory created for that object is getting freed or not.

And there are many more things which are causing the memory leak.

And bcoz of all this "system.stackOverFlowException" is getting displayed while running 24*7.
When we debug this application exception come where we have created COM object and called one of its function.

Plz let me know the solution if any.
Thanks in Advance!!!