Page 1 of 1

strings: Indirect delegate roots in remoting object

Posted: Fri Nov 02, 2012 6:06 am
by peterjc
Hi, I have been memory analysing one of our programs that uses .net remoting and seems to be consuming more and more memory over time.

Doing a single snapshot (after is has been running for some time), if I sort by Live bytes, the largest number of bytes are being held by strings.

Many of these strings seem to be namespace names of our objects, and the instance graphs typically look like the attached.

Does anyone know why we have so many of these strings, and why the remoting proxy seems to have them rooted?

Thanks in advance for any suggestions.
regards, Peter

Re: strings: Indirect delegate roots in remoting object

Posted: Sun Nov 04, 2012 9:31 pm
by Andreas Suurkuusk
If you have many strings that are rooted by remoting proxies, you probably also have many remoting proxies. A remoting proxy keeps information about the remoted object, and some of this information is stored in strings, and thus the proxies will keep the strings alive.

In your case I would focus on the proxies rather than the strings. As the memory analyzer says, the strings are indirectly held by a delegate. On the other hand, the proxies are directly held by the delegates, so I suggest that you investigate whether these delegates might cause a memory leak.

Re: strings: Indirect delegate roots in remoting object

Posted: Fri Nov 09, 2012 5:56 am
by peterjc
Thank you for that Andreas, I will look into this.

regards Peter