Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) [duplicate]

Tags:

php

memory

Possible Duplicate:
Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php

Hi,

In my php page, I got the error as follows,

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) 

I tried to set memory limit using ini_set('memory_limit', '128M');

But still I got the error.

Any help would be really appreciated.

like image 201
Rekha Avatar asked Sep 09 '10 06:09

Rekha


1 Answers

128 megabytes is 134,217,728 bytes. You've used up that memory. You either need to set the limit higher (if you can; I don't know if PHP will allow that) or simply use less memory in your code.

Do you expect your page to be using a lot of memory? If so, maybe raising the limit (or setting it to -1, which is somewhat dangerous in terms of allowing unlimited memory use) is the right thing to do. If not, look through your code for places where you could be effectively leaking memory. You might want to try replacing sections of your page with "dummy" blocks, one at a time, until you find the offending section.

like image 99
Jon Skeet Avatar answered Sep 20 '22 06:09

Jon Skeet