.NET Framework Bookmark and Share   
 index > .NET Remoting and Runtime Serialization > .NET remoting scalability against memory leaks
 

.NET remoting scalability against memory leaks

Hi

We have a problem with .NET remoting server. Our clients - GUI WinForms applications. Our server is a windows service. Remote objects exist as single call server activated objects.

We have a problem with memory leaks in some server objects. So our windows service memory usage is always extreamly increasing at the end of the day. We want to make another windows service and host some doubtful classes there. So our GUI client applications would know only about application server address in their config files as it was before (smth. like service.someorganisation.com:123456789/OurApplicationServer).

Then we want to transfer "bad" objects calls to the new windows service on the server side.

Could you tell us please the pros and cons of such design? Maybe somebody have an example codes of such a desicion? Will be appreciative in any help.

user2009_1
Hello,

It seems strange to me that a single call object would cause a memory leak.
After all, these objects are garbage collected right after your method returns.
Are you perhaps using objects that implement IDisposable? (such as SqlConnection for example)
That is, are you using them within your singlecall object?

By redirecting calls to another server, you only move the problem, not solve it.
Furthermore the redirect would slow down your calls as well (and the network too).
Stefan H.F. A.
Hi Stefan,

you are absolutely right, we use disposable objects(with using keyword)

.....
using(SmthDisposableObj obj = new SmthDisposableObj())
{
....
}
.....

By redirecting calls to another server, we will be able to reload it when we want (there will bethe functionality taht is not so important to us) and our main server will be stable - that's what we want to get with this decision
user2009_1
Hello,

Well as long as the disposables are within a using statement they are OK of course.

I don't know of any router within .NET remoting, such as a WSE router for web services.
However, I do know that it's the proxy that is routing the remote call to the actual object.
So, perhaps you could extend the RealProxy class to customize the routing process?
I found an article about the subject, but I do not have any experience with it myself, sorry!

http://msdn.microsoft.com/en-us/library/scx1w94y(VS.80).aspx

Kind regards,
Stefan
Stefan H.F. A.
Maybe it's possible by setting the "__Uri" property of the RealProxy to another link?

http://msdn.microsoft.com/en-us/library/system.runtime.remoting.proxies.realproxy.aspx
Stefan H.F. A.

You can use google to search for other answers

Custom Search

More Threads

• IDeserializationCallback.OnDeserialization() method called AFTER the OnDeserialized event
• Marshall unknown object classes to a remote client.
• Additional information: No connection could be made because the target machine actively refused it
• How to get a free port ?
• UserControl access via remoting
• Where it get stored?
• Is this a good idea (copying an object that doesnt implement clone)
• Problem retrieving Serialized Data
• How do I use .Net remoting for my C# Program??
• Generics dictionary MarshalObjbyRef