Page 1 of 1
Memery Allocation Error
Posted: Sat May 02, 2009 1:16 am
by abul
Fatal error: Out of memory (allocated 786432) (tried to allocate 1572864 bytes) in student.php on line 1015
This is the Error notification i am encountering while i execute the scripts.Please provide me the solutions for clearing this error.I want to know what the function that takes place while i reduce and increase the memory limit.Explain me the functionality in Detail.
Re: Memery Allocation Error
Posted: Sat May 02, 2009 1:18 am
by Benjamin

Moved to PHP - Code
Have you tried searching for information regarding the memory limit of PHP?
Re: Memery Allocation Error
Posted: Sat May 02, 2009 1:21 am
by Cirdan
I had this problem before. I fixed it by quoting a variable when using it inside the key part of an array. No idea why this fixed it
From: $array[$variable]
To: $array["$variable"]
Re: Memery Allocation Error
Posted: Mon May 04, 2009 10:49 am
by pickle
This is likely caused by an infinite loop, or you're processing a REALLY big object/array, or doing something in GD with a large image.
Re: Memery Allocation Error
Posted: Mon May 04, 2009 1:12 pm
by ldougherty
The error means that your script has exceeded the amount of memory allocated to php.
In your php.ini you will find this line
memory_limit = 8M
The configuration I've shown is for 8MB, if i am doing the math correct yours is 768KB
You will need to adjust this or you can attempt to do so via your code by using the following line at the top of your code.
ini_set('memory_limit', '8M');
Hope this helps.