DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 322975 - Last Review: February 27, 2014 - Revision: 4.4

This article was previously published under Q322975
This article has been archived. It is offered "as is" and will no longer be updated.

SYMPTOMS

You can use .NET Remoting to allow instances of any type that can be serialized to be passed as method parameters between the client and the server applications. However, if the type instance that is passed is very large (tens of megabytes), the Remoting client consumes large amounts of virtual memory and then generates unexpected exceptions. The exceptions can be either OutOfMemoryException exception or SocketException exception. The commit charge as seen in Task Manager is also very high.

CAUSE

This is because of a bug in the .NET Remoting system.

RESOLUTION

To work around this problem, pass smaller amounts of data with each remoted call. You can also pass a Stream object as a method parameter. Stream objects inherit MarshalByRefObject. You can use the Stream object to retrieve data in smaller chunks.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

When the class below is hosted in a Remoting host, and the method is called by a Remoting client, the problem occurs. The following code fragment demonstrates the problem:

	public class MBRClass : MarshalByRefObject
	{
		public byte[] GetBigByteArray ()
		{
			byte[] byteArray = new byte[60000000] ;
			return byteArray ;
		}
	}
				

APPLIES TO
  • Microsoft .NET Framework 1.0
  • Microsoft .NET Framework 1.0 Service Pack 1
  • Microsoft .NET Framework 1.0 Service Pack 2
  • Microsoft .NET Framework 1.1
  • Microsoft .NET Framework 1.1 Service Pack 1
Keywords: 
kbnosurvey kbarchive kbbug kbremoting KB322975
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support