ACC1x: GP Fault When Allocating Huge ArraysID: Q100175
|
When you try to allocate a huge array, you may receive a general
protection (GP) fault. The following error message appears:
An error has occurred in your application. If you choose Ignore, you should save your work in a new file. If you choose Close, your application will terminate.
If you have allocated an array element that includes a string or
variant data type and the size of the array exceeds 64K, you may
receive the error message described above, if the following criteria
are met:
Declare the array so that the last data segment contains a different number of elements from the first data segment.
Microsoft has confirmed this to be a problem in Microsoft Access versions 1.0 and 1.1. This problem no longer occurs in Microsoft Access version 2.0.
Access Basic has the ability to define huge arrays, larger than the
normal 64K data segment. Any element or index of a huge array may not
extend across the 64K-segment boundary. If all elements of the array
cannot be allocated within the 64K segment, only the elements of the
array that fit evenly in the segment are allocated. Microsoft Access
then allocates another 64K segment to the array and continues to fill
the new segment with the remaining elements.
If the size of the data type defined in the array is a power of 2, the
64K segment is completely full. If the size is not a power of 2, the
segment contains wasted space, since Microsoft Access cannot place a
portion of one element in one segment and the rest of that element in
the next segment.
Type Foosball
A(3000) As double
d As String
End Type
Data Segment #1 Data Segment #2
----------------- -----------------
Free space 17512 Free space 41524
Array(1) 24012 Array(3) 24012
Array(2) 24012
Data Segment #1 Data Segment #2 Data Segment #3
----------------- ----------------- -----------------
Free space 17512 Free space 17512 Free space 17512
Array(1) 24012 Array(3) 24012 Array(5) 24012
Array(2) 24012 Array(4) 24012 Array(6) 24012
Function Sample()
Redim Array(6) As Foosball
End Function
Additional query words: GP fault GPF array
Keywords : kbprg
Version : 1.0 1.1
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: March 23, 1999