Page 1 of 1

Newbe: Is this a leak

Posted: Fri Mar 06, 2020 2:23 pm
by Teddy_R
Hi.

I new to .Net profiler, and it is a bit owerwhelming..

I have this element that keeps coming up, but i'm not sure if it is a leak.

See image


Could sombody give me a hint.
- Does it look problematic ?

Basicly it is an XMLDocument that is added nodes from one thread, and then the node is removed quickly after from another thread

Image
https://imgur.com/gallery/bSyu29O

Re: Newbe: Is this a leak

Posted: Mon Mar 09, 2020 8:33 am
by Andreas Suurkuusk
The instance graph shows that you have an XmlDocument that is kept alive through the X_Doc field of a Lokal_bon instance. As long as you intend to use the data in the XmlDocument again this is not a memory leak. And since the Local_bon instance is referenced be a method (Send_the_rest) it seems like it is being actively used when the snapshot was collected.

Once the XmlDocument is no longer needed, the X_Doc field of the Lokal_bon can be set to null and then the XmlDocument may get eligible for garbage collection (unless it's referenced by other instances/roots).

Re: Newbe: Is this a leak

Posted: Mon Mar 09, 2020 1:43 pm
by Teddy_R
Thanks.

That puts my mind to rest
:D