title: Advices - I need to develop a script with hight memory usage and long duration
body: <p>I have a new challenge today. I will develop a script that will take some large data_log (fopen) and insert it into a database. Yesterday I did my first tests, and I estimate that this script will need a week running to process the log.</p>
  
  <p>I made some env configs, like <code>set_time_limit</code> and <code>set_memory_limit</code>.</p>
  
  <p>But, in this first test after an while (15min), the app crashes. The machine was running in 2gb memory usage when it crashes.</p>
  
  <p>The msg error: </p>
  
  <pre><code>PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y) in whatever.php
  </code></pre>
  
  <hr>
  
  <p>Please keep in mind that the script/code is ok.</p>