Home › Forums › Support › System.OutOfMemoryException › Reply To: System.OutOfMemoryException
February 7, 2014 at 13:24
#1471
Anonymous
Inactive
Thanks for posting your issue. The OutOfMemoryException occurs because the compression stage, which is enabled by default, is a fairly memory intensive operation.
You should be able to avoid this problem by disabling the compression on both client and server. Simply add this line to the start of your applications:
NetworkComms.DefaultSendReceiveOptions = new SendReceiveOptions<ProtobufSerializer>();
I would also recommend caching the connection list on the server:
var list = NetworkComms.GetExistingConnection().ToList();
and only updating the cache every 5 seconds or so. This will greatly increasing the performance of the polling.
If you have any further questions please feel free to post back.
Kind regards,
Marc