ststeiger / trust4

Automatically exported from code.google.com/p/trust4
0 stars 0 forks source link

Insufficient system resources exist to complete the requested service.(Serialize for a big object, it will occur this issue) #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When I use protobuf-net to serialize a big dictionary object it throws an 
exception. The some program when it run to serialize a small object, it works 
fine. When the object size is larger than 50M, it will throws the exception as 
follows. I want to know how to fix this issue.

Exception Details:

Insufficient system resources exist to complete the requested service.

System.IO.IOException: Insufficient system resources exist to complete the 
requested service. at System.IO.__Error.WinIOError(Int32 errorCode, String 
maybeFullPath) at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, 
Int32 count) at ProtoBuf.SerializationContext.WriteBlock(Byte[] buffer, Int32 
offset, Int32 count) in 
c:\protobuf-net_fixed\trunk\protobuf-net\SerializationContext.Write.cs:line 51 
at ProtoBuf.SerializationContext.WriteLengthPrefixed[TValue](TValue value, 
UInt32 underEstimatedLength, ILengthProperty`1 property) in 
c:\protobuf-net_fixed\trunk\protobuf-net\SerializationContext.Write.cs:line 156 
at ProtoBuf.Property.PropertyPairString`3.Serialize(TSource source, 
SerializationContext context) in 
c:\protobuf-net_fixed\trunk\protobuf-net\Property\PropertyPairString.cs:line 35 
at ProtoBuf.Property.PropertyList`3.Serialize(TSource source, 
SerializationContext context) in 
c:\protobuf-net_fixed\trunk\protobuf-net\Property\PropertyList.cs:line 42 at 
ProtoBuf.Serializer`1.Serialize(T instance, SerializationContext context) in 
c:\protobuf-net_fixed\trunk\protobuf-net\SerializerT.cs:line 371 at 
ProtoBuf.Serializer`1.SerializeChecked(T instance, SerializationContext 
destination) in c:\protobuf-net_fixed\trunk\protobuf-net\SerializerT.cs:line 
329 at ProtoBuf.Serializer.Serialize[T](Stream destination, T instance) in 
c:\protobuf-net_fixed\trunk\protobuf-net\Serializer.cs:line 672 at 
Adchina.CampaignReport.Tasks.AttrClusterTaskLogic.SerializeAttributionReport(Ser
ializeParameters args) in 
E:\DMP\SOURCE\Adchina.CampaignReport\Adchina.CampaignReport.Tasks\AttrClusterTas
kLogic.cs:line 216

For the project reason, I cannot change the v1 to v2. If anyone knows the 
solution for this issue, thank for tell me~

My Program is as follows:

                using (FileStream fs = new FileStream(filePath, FileMode.Create, FileAccess.Write))
                {
                    Serializer.Serialize(fs, args.AttrSerialization);
                }

Original issue reported on code.google.com by davidjef...@gmail.com on 16 Mar 2014 at 3:02