NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
E_ERROR (Allowed memory ... exhausted)


Joined: 17 Dec 2013
Posts: 13
Reply with quote
Hi

Apologies if this is the wrong section.

I am running PHPeD 12

When I run my code using the debugger and step through it using F8 - after a short while I the message

Error: E_ERROR(Allowed memory size of 134217728 bytes exhausted (tried to allocate 625375 bytes))

This is on Win 7 4GB memory 64 bits

Task manager shows PHPed using 152,684k, and only 61% of memory on the laptop being in use.

Please can someone help me with this problems?

Thanks

Gepff
View user's profileFind all posts by kathekasSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
It is probably the wrong section and unlikely to be anything to do with PhpED Wink

You probably need to increase the amount of memory that PHP is allowed to use. It looks like your PHP is currently limited to 128MB.

The php.ini file will need editing. You can find the location of that file by using:

Code:
<?php
phpinfo();


Find the line that says memory_limit and assign a new value such as 256M noting that you use M and not MB.

Code:
memory_limit = 256M


Then restart the web service (eg Apache) so that it picks up the change.

With some web server configurations you can also do this from the .htaccess file:

Code:
<IfModule mod_php5.c>
  php_value memory_limit 256M
</IfModule>


Don't assign too much memory; very few scripts require more than 256MB and that is a common memory limit requirement for many web applications. Giving too much memory to PHP can also hide some script issues. If your script had an error causing it to run out of memory, more memory means it will take longer before it ultimately fails again.

Some operations require more memory, image manipulation being a good example. Also the more PHP extensions you have loaded, the more memory you require, so only enable required extensions.
View user's profileFind all posts by plugnplaySend private message


Joined: 17 Dec 2013
Posts: 13
Reply with quote
Thanks very much for your detailed response, very much appreciate.

I increased the memory to 256 as suggested by still got the error.


Not sure what to do now.

Thank you for reading.


Last edited by kathekas on Tue Jun 03, 2014 12:08 am; edited 1 time in total
View user's profileFind all posts by kathekasSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
The error indicates your PHP still has the same memory available. If you do the phpinfo() again, how much does that show against memory_limit ?
View user's profileFind all posts by plugnplaySend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Then restart the web service (eg Apache) so that it picks up the change

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 17 Dec 2013
Posts: 13
Reply with quote
I am afraid I have been stupid. I altered the memory allocation for apache and not the webserver in PHPeD. Sorry.

The script I have is doing screen scraping. It saves the webpage to a file, which is 200k and extracts data from it.

While parsing the file it does about 20 loops.

With the memory increased to 500m, the programs crashes on the second iteration.

Thank you very much for the help.
View user's profileFind all posts by kathekasSend private message
E_ERROR (Allowed memory ... exhausted)
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic