[ Home | Forums | About | Sponsors ]
  Welcome, Guest. Please Login or Register
Google
 
Web gotmono.com
  We've upgraded the forum software.  Please login to enjoy the new features.  If there are any issues or concerns, please message admin.
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
(Read 459 times)
tigger
YaBB Newbies
*
Offline

I Love Mono!
Posts: 1

Problems with arrays over 4gb on 64 bit Itanium
Dec 8th, 2008, 8:42pm
 
Hi,

I am running into an odd problem on a 64bit Itanium system. I compiled mono from tarball (v1.9.1) and ran into some memory problems which I pinned down with a test program. When I try to create an array that is bigger than 4gb in size, e.g. a large double[,], I get an out of memory exception although the system has far more memory. I tested if I am actually running in 64bit by checking the pointer size in the program and it is 8 bytes.

Any help is welcome, thanks.

Cheers,
Christian


p.s. The test program:

static void Main(string[] args)
       {
           Console.WriteLine("SizeOf IntPtr is: {0}", IntPtr.Size);

           int iRows = 35750;
           int iCols = 15000;
           long bytes = 0;

           try
           {
               while (iRows < 37000)
               {
                   bytes = (long)iRows * (long)iCols * (long)sizeof(double);
                   double[,] Dbl = new double[iRows, iCols];
                   Dbl[0, 0] = 0;
                   Console.WriteLine(Convert.ToString(bytes / (1024 * 1024)) + "MB allocated or double[" + iRows + "," + iCols + "]");
                   iRows += 250;
                   GC.Collect(2);
               }
           }
           catch (OutOfMemoryException e)
           {
               Console.WriteLine("Unable to allocate: " + Convert.ToString(bytes / (1024 * 1024)) + "MB or double[" + iRows + "," + iCols + "]");
               Console.WriteLine(e.Message);
           }
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print
 

Copyright © 2003-2008, The Mono Community
Website Design donated by IdeaZone.ca