.Net Remoting Memory Horror (IPC channel)
-
Hi, i have an application which is running as a windows service, it's purpose is to poll different sensors in a specific interval. No problem so far and with .Net memory profiler i was able to reduce the memory consumption drastically (allocs are almost -> 0 byte/s). But now the downside, my idea was to present the sensors data on a ASP.NET page. My first thought was using a webservice to connect the windows service with the IIS. However after reading a comparison between Remoting vs. Webservices i decided to do remoting with an IPC channel. So far so good, i have implemented a very light Remoting object, in addition i use the IPC channel and binary formatters. But when my application was finally running i discoverd that each remoting call will take around 8 KB of memory! Furthermore it allocates at least 178! Instances of differnt .Net classes for each call. Imagine that i have to update my data on the IIS every second and addionally i have more than one sensor. This would mean for example that 5 Sensors would cost 40 KB or more memory per second, surely the garbage collector will take care of it. But how long will it take until i get in serious memory trouble (like Memory Pressure by the framework)? I saw that the garbage collector is triggered every 10 s in the current setup (without remoting it's between 45 min - 2h) There are a couple of Questions: 1. Is it possible to reduce the memory consumption of .Net remoting? (i saw no difference between singleton & singecall) 2. Is remoting not the right choice for my task? BTW: The service is written in C++/CLI, the logic and pages on the IIS are in C#. I would really appreciate any help! If needed i could also publish some code to resolve the issue. ThanX Tobias the remoting Interface (each call of GetIndex costs 8KB): public interface class IRemotingLink { ArrayList^ GetSensorKeys (void); array ^ GetIndex (String^ pSensorGuid, unsigned char pIndex); array ^>^ GetIndices (String^ pSensorGuid); bool SetIndex (String^ pSensorGuid, unsigned char pIndex, array ^ pIndexContent); }; -- modified at 2:34 Friday 10th March, 2006