Circular object reference...

  • Thread starter Thread starter Zhenxin Li
  • Start date Start date
Z

Zhenxin Li

I'm writing a server service which will process large amount of data. The
internal data structure contains complex circular object references. I
notice out-of-memory after the service runs for some time.

When I use memory profiler tool to view the whole memory map, I find those
circular referenced objects are not freed but the root reference where the
objects are allocated has been set to null.

Is .net garbage collector able to handle complex circular object reference
correctly? Or I have to dereference all the circular references myself?

Thanks!
zxli
 
Zhenxin Li said:
I'm writing a server service which will process large amount of data. The
internal data structure contains complex circular object references. I
notice out-of-memory after the service runs for some time.

When I use memory profiler tool to view the whole memory map, I find those
circular referenced objects are not freed but the root reference where the
objects are allocated has been set to null.

Is .net garbage collector able to handle complex circular object reference
correctly? Or I have to dereference all the circular references myself?

Yes, the GC can handle circular references. It sounds like you've
probably got a reference somewhere else.
 
Back
Top