[Gambas-user] array size limitations relative to available RAM and swap space
Benoît Minisini
gambas at ...1...
Sat Jan 23 12:33:05 CET 2010
> Using GAMBAS 2.19 I tried creating an array:
>
> PUBLIC Elevation AS Short[65536, 65536]
>
> With no data assigned to any of the array's elements, reading
> Elevation[0,0] shows a value of 24. I'm thinking it should be zero.
> Reading
> Elevation[4095,0] crashes the program. I tried reading Elevation[100,100]
> from the debug window and it also crashes the program.
>
> Granted this array if fully allocated would consume 8 gigabytes of RAM. My
> system has 4 gigs of RAM and an 8 gig swap file. Does GAMBAS use the swap
> file if enough physical RAM isn't available? What are the size constraints
> of arrays? Why would Elevation[0,0] show up as 24 when Elevation[1,1],
> etc., are zero as they should be?
>
> -----
> Kevin Fishburne, Eight Virtues
> www: http://sales.eightvirtues.com http://sales.eightvirtues.com
> e-mail: mailto:sales at ...1887... sales at ...1887...
> phone: (770) 853-6271
>
This is bug in Gambas2 that did not correctly detect when arrays are too big.
I backported a fix for that from Gambas3 in revision #2627, so now you will
get the expected error instead of a weird behaviour.
Regards,
--
Benoît Minisini
More information about the User
mailing list