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

tiggger prokopp at gmail.com
Wed Dec 10 05:05:45 EST 2008


Thanks for the idea Alan but the big array switch is for array index size
over 32bit. In my case the index is smaller (factor 8 because I use double)
but the memory the array data covers exceeds 4gb and that raises the
problem.

For example if I use more than 4gb or 2^32 bytes in one array I get an out
of memory error but the index size is only 2^29 because a double is 8 or 2^3
bytes.

Cheers,
Christian


Alan McGovern-2 wrote:
> 
> 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
>>
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 
> 

-- 
View this message in context: http://www.nabble.com/Problems-with-arrays-over-4gb-on-64-bit-Itanium-tp20930391p20932278.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list