limit to the size of an array?
Moderator: General Moderators
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
limit to the size of an array?
I am currently developing a large web application that may hold 1000's if not millions of records in the database.
now lately i have been starting to, instead of doing while loops to print out data, firstly put it all in an array and then use for loop to print out what i want.
I much prefer this way as i find it easier to handle what is getting outputted, however i am worried about an array getting too large.
I am just wondering whats the limit and what actually happens if it exceeds it?
Thanks
Mal
now lately i have been starting to, instead of doing while loops to print out data, firstly put it all in an array and then use for loop to print out what i want.
I much prefer this way as i find it easier to handle what is getting outputted, however i am worried about an array getting too large.
I am just wondering whats the limit and what actually happens if it exceeds it?
Thanks
Mal
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
it is already a shortened query, however as i already stated, i have started putting all data into an array and then outputting from there.timvw wrote: Or you could specify your query more, so you only get rows you actually want to output
ive never learnt about iterators yet, looks like i'll have to go have a look....
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
iterating through the array, summing the string lengths of indices and values should give you a rough estimate. Note: remember to check the type, int's are 4 or 8 bytes; decimals are 4, 8, or 16 bytes; strings could easily be double byte characters. On a quick run through the functions, I didn't see an internal memory usage gauges..
See last few posts here: viewtopic.php?t=19906&start=45.
You really, really want to use iterators though.
You really, really want to use iterators though.