max size of array

  • Thread starter Thread starter Jesper F
  • Start date Start date
J

Jesper F

I'm trying to fill a 2-dimensional array with ca. 2.000.000 records and I'm
getting a 'out of memory' error. Is that due to limitations on my machine or
in VBA or something else?

Jesper
 
I'm trying to fill a 2-dimensional array with ca. 2.000.000 records and
I'm getting a 'out of memory' error. Is that due to limitations on my
machine or in VBA or something else?

Are you using Access? If so, why load the records into an array? Access
them (no pun intended) directly from the table.

Tom Lake
 
I would suspect that it has to do with the amount of ram you have and how
large the elements of the array are.

Not counting the overhead involved with the setting up and maintaining the
array (Don't ask me, I don't know how much), you have 2,000,000 * 2 *
average field size bytes of space being used for this array.

Megabyte = 1 million bytes so very, very roughly
4 * average field size = number of megabytes needed to build the array. 40
character field can be 80 bytes (depending on character set)

4*80 = 320 megabytes of memory (plus overhead)

All of the above calculation being done early in the morning so now
guarantees that I didn't screw something up.
 
Back
Top