Im am running a query and retrieving with OCI_FETCH_ARRAY and I am getting a fatal error, out of memory after I hit a certain volume of records. The result array is 100k rows and about 60 columns.
I have my memory_limit in php.ini set to 2 gigs.
memory_limit = 2056M
It seems to happen when I have more than one person running the script at the same time (or same person running twice as it is set up to run in the background). It only takes 2 concurrent jobs of 100k records to cause the error. Everything I've found on OCI_FETCH_ARRAY states that it isn't caching the whole result set in to memory but it looks like it IS.
This is my code (Very straight forward)
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
array_push($resultfile,$row);
$tablerow=$tablerow +1;
unset($row);
}
The error happens on the OCI_FETCH_ARRAY statement after it hits a certain number of loops.
The output file is only 94m (avg) so doesn't seem like I should be anywhere memory limit.