Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fatal error: Allowed memory size

Status
Not open for further replies.

Fishtails

Technical User
Feb 12, 2002
6
US
I am having a problem with server errors and was wondering if anyone has had similar problems and/or know of a possible solution.

Of immediate concern is the following error message which has been ailing mine and other sites hosted on the same server;

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 46080 bytes) in /home/fish-tai/public_html/BETA/includes/blocks/poll.php on line 193

Also.....

numerous occurences of "Page cannot be displayed" or "server returned an unrecognized response".

At first I thought it had something to do with the PostNuke CMS I use, however, after further investigation I have learned that other sites on the same server are having the same problems and they are not using PostNuke, but are php driven.

Has anyone experienced these problems before and did you find a solution?

I have heard that php 4.0.6 had a bug affectin a memory leak and I have informed my host. They have recently upgraded php to 4.1.1 , however this did not correct the problem.

One thing I don't quite understand is how the memory is being allocated. Is that for the actual scripts? Could the scripts be too large or does it have to do with the amount of memory being used when creating the arrays or what not from mysql database?

Thanks for any help.
 
What is line 193 in /home/fish-tai/public_html/BETA/includes/blocks/poll.php attempting to do?

Have you noticed this message always appearing when trying the same commands or doing certain functions?
 
Line 193 is simply trying to update the database for the number of total votes taken so far.

However, this error occurs in other pages with different includes as well executing different functions. After I posted, I found some others having the same problem, posted at phpbuilder, with different scripts. One possibility they say is the actual size of the script being run, but never had this problem before running the same software.

I'm a little perplexed.
 
46K is a lot of memory unless that is shared across all of the users on your virtual server. Are you using large arrays (a lot of elements) or working with very large recordsets (size wise)?

Have you tried freeing up resources as you no longer need them as opposed to PHP doing it when the script is completed? Perhaps there is a memory leak or something that is growing when it shouldn't be.
 
I found something on mysql_free_result() but have not tried it yet. It seems I remember seeing it somehwere in the code, but wasn't paying attention to it when I was configuring the setup. I'm guessing that, since the problem started when my host upgraded from 4.02 to 4.06, that it has to do with the bug reported at php.net regarding the memory leak. Anyway, I just learned that my host had not upgraded to 4.1.1 yet as I had thought, but was assured the upgrade will be complete by this weekend along with an Apache upgrade. Let's see if this clears it up and I'll report my findings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top