[Mono-bugs] [Bug 73882][Nor] New - Unable to allocate more than 1Gb of memory with mono

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 19 Mar 2005 11:28:38 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by vargaz@gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=73882

--- shadow/73882	2005-03-19 11:28:38.000000000 -0500
+++ shadow/73882.tmp.9743	2005-03-19 11:28:38.000000000 -0500
@@ -0,0 +1,56 @@
+Bug#: 73882
+Product: Mono: Runtime
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: GC
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vargaz@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Unable to allocate more than 1Gb of memory with mono  
+
+As reported on mono-devel-list:
+
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+class MemoryChecker
+{
+       public const int MB = 1000000;
+
+       [STAThread]
+       static void Main(string[] args)
+       {
+               Console.WriteLine("Pointer size(in bytes): {0}",
+IntPtr.Size);
+
+               byte[][] bigArray = new byte[10000][];
+
+               int index = 0;
+               while(true)
+               {
+                       try
+                       {
+                               bigArray[index++] = new byte[MB];
+                       }
+                       catch(Exception e)
+                       {
+                               Console.WriteLine("Max Mb block allocated:
+{0}", index);
+                               Console.WriteLine(e);
+                               break;
+                       }
+
+               }
+       }
+}
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+The issue here is that libgc allocates memory using sbrk, and that seems
+to fail even if psychical memory is available. Perhaps USE_MMAP should be
+defined on linux ?