strings: Indirect delegate roots in remoting object

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
peterjc
Posts: 3
Joined: Fri Nov 02, 2012 5:55 am

strings: Indirect delegate roots in remoting object

Post by peterjc » Fri Nov 02, 2012 6:06 am

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
Attachments
screenshot1.png
string instance graphs

Andreas Suurkuusk
Posts: 1028
Joined: Wed Mar 02, 2005 7:53 pm

Re: strings: Indirect delegate roots in remoting object

Post by Andreas Suurkuusk » Sun Nov 04, 2012 9:31 pm

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.
Best regards,

Andreas Suurkuusk
SciTech Software AB

peterjc
Posts: 3
Joined: Fri Nov 02, 2012 5:55 am

Re: strings: Indirect delegate roots in remoting object

Post by peterjc » Fri Nov 09, 2012 5:56 am

Thank you for that Andreas, I will look into this.

regards Peter

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests