Hi, I'm getting the error...
Fatal error: Out of memory (allocated 1827405824) (tried to allocate 88800 bytes)
..when I run my PHP script.
I've added this line to my PHP script..
ini_set("memory_limit","3000M");
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...
memory_limit = 3000M

Does anyone know if the memory is restricted elsewhere?

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().

(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.)

Thanks.

    update. sample code that causes the problem. (Yes, Yes, I know its a huge image but its just a one of thing).

    <?php
        ini_set("memory_limit","4000000000");
        echo "ini_get = " . ini_get('memory_limit') . "<br>\n";
        echo "memory_get_usage = " . memory_get_usage(true) . "<br>\n";
        $bigImageHandle = imagecreatetruecolor(22200, 24800);  //this is line 5
    ?>

    Browser output...

    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
      Write a Reply...