title: Upper memory limit for PHP/Apache
body: <p>I'm getting the error when I run my PHP script....</p>
  
  <pre><code>Fatal error: Out of memory (allocated 1827405824) (tried to allocate 88800 bytes)
  </code></pre>
  
  <p>I've added this line to my PHP script..</p>
  
  <pre><code>ini_set("memory_limit","3000M");
  </code></pre>
  
  <p>This statement does seem to correctly control the memory usage, but I dont seem to be able to get it above about 1.8GB.
  Its as if the upper memory limit is being restricted somewhere else.
  I've also added to the php.ini...</p>
  
  <pre><code>memory_limit = 3000M
  </code></pre>
  
  <p>Does anyone know if the memory is restricted elsewhere?</p>
  
  <p>I'm running a local server with Xampp. 
  I have Windows 7, 64-bit with 4GB RAM.
  My script uses PHP's GD image library and I get the error when trying to allocate an image reference with ImageCreateTrueColor().</p>
  
  <p>(I know this is a huge amount of memory - but this is just a one-of script, and its just a lot easier to do it this way.)</p>
  
  <p>Thanks.</p>
  
  <p>Update....</p>
  
  <p>@elusive @Orbling
  I expect everybody's bored whith this question, but here is the simplified code which illustrates the problem.</p>
  
  <pre><code>&lt;?php
      ini_set("memory_limit","4000000000");
      echo "ini_get = " . ini_get('memory_limit') . "&lt;br&gt;\n";
      echo "memory_get_usage = " . memory_get_usage(true) . "&lt;br&gt;\n";
      $bigImageHandle = imagecreatetruecolor(22200, 24800);  //this is line 5
  ?&gt;
  </code></pre>
  
  <p>Browser output...</p>
  
  <pre><code>ini_get = 4000000000
  memory_get_usage = 524288
  
  Fatal error: Out of memory (allocated 1843396608) (tried to allocate 88800 bytes) in
  E:\User\My_Webs\experiments\houseshunting\temp\osMaps\t1.php on line 5
  </code></pre>
  
  <p>I tested this out with a smaller set of tiles and the memory used by imagecreatetruecolor() and I estimate I need 2.7GB </p>