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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is causing an erealloc() error?

Status
Not open for further replies.

JasonL99

Programmer
Oct 17, 2002
25
US
We frequently get "erealloc(): Unable to allocate 1441792 bytes" errors in our error log. It seems that every time this happens a user of our application gets a page cannot be found error or their session data gets lost. Any idea of what causes this error or how to fix it?

We are currently running php 4.2.3 in apache on a windows 2000 server.

Thanks
 
A search of the PHP bug-reporting system shows that error cropping up quite a bit (link to 'erealloc' bug list)

Without knowing what your site is doing, it's difficult to say what is going on. But the "erealloc()" errors seem either to have to do with having no memory available [a script that uses fpassthru() with large files] or memory leaks in PHP module libraries [problems with on-the-fly zlib compression of pages].

I have also personally seen this error with recursive script functions that used too many variables storing too much information on each iteration. In that circumstance, the error was generally followed by a stack fault crash. When I quit doing stupid things in my code, the fault went away.


As a first piece of advice, I recommend that you upgrade PHP. The version you reported using, 4.2.3, was released 2002-08-06 (three and a half years ago), so there has been a lot of bug-swatting.

As a general rule, I recommend going to PHP 5.x, as that is where the emphasis on development seems to be, but often the latest 4.x version benefits from code from the 5.x branch.





Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top