[Mono-list] Too many heap sections: Increase MAXHINCR orMAX_HEAP_SECTS
Jonathan Gagnon
jonathan.gagnon at croesus.com
Thu May 10 10:14:44 EDT 2007
Hi,
Here's a little more information. Looking at the stacktrace, I noticed that
this problem always happens when trying to serialize a big List<> into a
MemoryStream. My guess is that because the memory stream needs to be
expanded many times in the process, il leads to memory fragmentation.
What is weird though, is that I don't have the same behavior if I run the
same application with mono on Windows. On windows, I am able to get
further, but I eventually get an out of memory error, which is weird because
if I run the application with .NET, the allocated memory never goes beyond
150 megs.
Any idea what could explain the difference in behavior between the 2 OS?
I'd also like to know if mono uses a large object heap like .NET for objects
larger than a certain number of bytes (85000 bytes in .NET) and what is that
number of bytes.
Here is the actual error I get on Linux, in case it could help :
Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS
Stacktrace:
at (wrapper managed-to-native)
System.Object.__icall_wrapper_mono_object_new_fast (intptr) <0x00004>
at (wrapper managed-to-native)
System.Object.__icall_wrapper_mono_object_new_fast (intptr) <0xffffffff>
at System.Array.GetEnumerator () <0x0000d>
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteSingleDimen
sionArrayElements (System.IO.BinaryWriter,System.Array,System.Type)
<0x00020>
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectArray
(System.IO.BinaryWriter,long,System.Array) <0x0003f>
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteArray
(System.IO.BinaryWriter,long,System.Array) <0x00046>
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInsta
nce (System.IO.BinaryWriter,object,bool) <0x00143>
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjec
ts (System.IO.BinaryWriter) <0x0002d>
at
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph
(System.IO.BinaryWriter,object,System.Runtime.Remoting.Messaging.Header[])
<0x0003a>
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
(System.IO.Stream,object,System.Runtime.Remoting.Messaging.Header[])
<0x0020c>
at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize
(System.IO.Stream,object) <0x00015>
at MyCompany.MyClass.Serialize (System.IO.MemoryStream&,object,bool)
<0x00068>
at MyCompany.MyClass.ExecuteRequest
(System.Guid,MyCompany.MyClass.MyEnum,System.Guid,object[]) <0x00153>
at (wrapper delegate-invoke)
System.MulticastDelegate.invoke_void_Guid_MyEnum_Guid_object[]
(System.Guid,MyCompany.MyClass.MyEnum,System.Guid,object[]) <0xffffffff>
at (wrapper runtime-invoke)
ExecuteRequestDelegate.runtime_invoke_void_Guid_MyEnum_Guid_object[]
(object,intptr,intptr,intptr) <0xffffffff>
Thanks,
Jonathan
_____
De : mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] De la part de Jonathan Gagnon
Envoyé : Wednesday, May 09, 2007 1:26 PM
À : Mono-list at lists.ximian.com
Objet : [Mono-list] Too many heap sections: Increase MAXHINCR
orMAX_HEAP_SECTS
Hi,
I have an application that runs fine with .NET, but when I run it with mono,
I get the following error :
Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS
What could be the source of this problem and how can I increase those values
(MAXHINCR or MAX_HEAP_SECTS)?
I'm using mono 1.2.3.1.
Thanks,
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20070510/bd03229f/attachment-0001.html
More information about the Mono-list
mailing list