[Mono-list] Problems with arrays over 4gb on 64 bit Itanium

Alan McGovern alan.mcgovern at gmail.com
Wed Dec 10 03:44:15 EST 2008


There's a compile time switch you need to enable so you have large array
support I think. That means you need to pass this flag when compiling "--*
enable*-big-*arrays"

Alan.
*
On Wed, Dec 10, 2008 at 7:38 AM, tiggger <prokopp at gmail.com> wrote:

>
> 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);
>           }
> --
> View this message in context:
> http://www.nabble.com/Problems-with-arrays-over-4gb-on-64-bit-Itanium-tp20930391p20930391.html
> Sent from the Mono - General mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20081210/f0cbc1d7/attachment.html 


More information about the Mono-list mailing list