Hi,
We have built a file sync solution using custom provider, to sync contents of two folders kept at two remote computers.
However, this is throwing error "System.OutOfMemoryException" when the file size is about 1 GB.
Can someone suggest how this issue can be fixed? Below is the stack trace:
"Exception of type 'System.OutOfMemoryException' was thrown.
Server stack trace:
at System.IO.ByteBufferPool.GetBuffer()
at System.Runtime.Remoting.Channels.ChunkedMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BinaryWriter.Write(Byte[] buffer)
at System.Runtime.Serialization.Formatters.Binary.__BinaryWriter.WriteSingleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, Int32 length, Int32 lowerBound, Array array)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteArray(WriteObjectInfo objectInfo, NameInfo memberNameInfo, WriteObjectInfo memberObjectInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SerializeMessage(IMessage msg, ITransportHeaders& headers, Stream& stream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at RemoteSync.Remoting.RemotingType.UploadFile(String folderPath, ItemMetadata item, Byte[] fileBytes, FileInformation fileInfo)
at RemoteSync.SyncFramework.RemoteStore.SaveItemChange(SaveChangeAction saveChangeAction, ItemChange change, SaveChangeContext context) "