PHP oci_fetch_array导致内存不足错误

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.

below code is causing high memory usage :

array_push($resultfile,$row);

oci_fetch_array is unbuffered meaning it will fetch rows one by one until no rows exists. I would suggest not to push row into another array. instead write your logic inside while loop itself.