I am working on a client-server solution using .NET 2.0 Remoting (server activation, binary formatting over TCP, Vista Ultimate) for communication purposes. I am currently profiling the application and running everything on the same machine. I noticed that if I run the application, everything works fine for several minutes, and then suddenly every remote call takes several seconds. I have an entrance at both ends and every call. Server-side implementation only takes a fraction of a second, while the entire remote call is slow. Further profiling showed that remote defragmentation is on the server side: during internal operation of the remote service, it takes about a split second, the answers are very slow. If I restart the server, everything will return to normal again within a few minutes.
Has anyone experienced something like this?
Thanks!
UPDATE: I checked if I set the lifetime for my remote object, say, for 1 day, I still have the same problem.
UPDATE: I use the template suggested by Ingo Ramer ( HOWTO: use remote objects based on the interface with the configuration files ) for all my deleted things, if that matters.
Client Code:
public static object CreateInstance(Type type) { if (!Initialized) InitWellKnownTypesCache(); WellKnownClientTypeEntry typeEntry = (WellKnownClientTypeEntry)wellKnownTypesCache[type]; if (null == typeEntry) throw new RemotingException("Type not found."); if (string.IsNullOrEmpty(serverObjectActivationUri)) throw new RemotingException("ServerObjectActivationUri wasn't configured. Cannot create server object instance."); return Activator.GetObject(typeEntry.ObjectType, string.Format(serverObjectActivationUri, typeEntry.ObjectUrl)); }
On the server side, there is nothing but the correct configuration file, which looks like this:
<service> <wellknown mode="Singleton" type="MyDomain.SomeDomain, MyDomain" objectUri="SomeDomainService" />
I do nothing except RemotingConfiguration.Configure ("MyDomainService.exe.config", false); neither on my server nor on client code.
wasker
source share