title: Allowed memory size of 134217728 bytes exhausted (tried to allocate 31989760 bytes) In a do...while loop
body: <p>I have a do while code that reaches to an API to get data from AWS Elastic search. When I increase size, I get memory error. Now I have reduced size to 20, but want to loop through the results as a cronjob yet, it fails. I have increased memory to 4096 yet, it fails</p>
  
  <p>I have increased memory limit in my .ini file, yet it fails. Since its a cronjob, I have no idea how to use scroll.</p>
  
  <pre><code>do {
    $transporter  = new TransporterController;
    $response = $transporter-&gt;dispatchSearch($paper-&gt;title, '55%', $size, $from, $rounds );
    $json_response = json_decode((string) $response-&gt;getBody(), true);
    $rounds = $json_response['rounds'];
    $from = $json_response['from'] + $json_response['size'];
  
    $response = $transporter-&gt;purify($response, $object);
    $impact_user_id = $paper-&gt;impact_user_id;
    $impact_type_id = 2;
    $response = $transporter-&gt;saveResult($response, $impact_user_id, $impact_type_id);
    $transporter-&gt;notifier($response, $user);
  } while ($rounds &gt; 1);
  </code></pre>
  
  <p>The idea is for the loop to run to completion, until last page. This is a laravel cronjob. </p>