Re: Size of Arrays

From: Date: Fri, 30 Jan 2004 13:55:15 +0000
Subject: Re: Size of Arrays
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-176339@lists.php.net to get a copy of this message
Hi at all, > Indeed. The following script had my machine happily swapping like crazy > at 320,000 array items (each being 1k, task manager showed 640meg total > memory in use on this development machine with 512meg RAM running WinXP). > > <?php > while (@ob_end_flush()); > $data = Array(); > while (true) > { > $data[] = str_repeat('#', 1024); > print count($data)."\n"; > } > ?> > > To the OP, why do you need to store all the items in memory at the same > time? Can't you read some, process them then read the next lot, process > them, read the next lot.... etc? No I couldn't because we have to use 1,6 Mio values direktly. If we read them each for each it will take a lot of time. We discover we can use an Array with 2.000.000 Values - if higher the server (Intel 1 GHz, 32 Bit, 1 GB RAM) gives up. Ciao, Sandro

« previous php.general (#176339) next »