Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

max size of array

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jesper F - 31 Jan 2006 07:56 GMT
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
Tom Lake - 31 Jan 2006 09:01 GMT
> 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
John Spencer - 31 Jan 2006 13:40 GMT
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.

> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.