memory leak with php upgrade - help?

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
redtango88
Forum Newbie
Posts: 1
Joined: Tue Aug 22, 2006 4:27 am

memory leak with php upgrade - help?

Post by redtango88 »

For several months now we have had a very irritating problem with our website - we have RSS feed on 4 pages and for about 1 in 10 days these pages do not render properly. The page will load up to the feed, hang for a while and then just leave the pieces it has loaded which means a partially rendered page. As one of these pages is our home page then its safe to assume that any visitors have given up and gone elsewhere.

We have had to take the RSS off but we would like to put it back on.

Our ISP say that we need to move servers at great disruption to us and are not sure that this will solve the problem. Following a lot of pushing from me they have now suggested a reason for the problem..... see quote below

"With regards to the RSS issue, PHP crashes due to a memory leak which appears to be a problem with the current version of PHP on the server you are on and what your code is trying to achieve. When the memory leak occurs the website times out. We can migrate you onto another server with a lower version of PHP but cannot guarantee you will not experience the same difficulty. "

Our site is not complex - static html pages with php includes for the menus and gutter areas - the RSS pulls from various sources and uses either Carp or FeedDigest. All feeds behave badly at the same time and the problem lasts anywhere from an hour to a day then reverts back to working perfectly.

I am looking for some help in understanding whether the server move that the ISP is suggesting is a good solution or whether we are being fobbed off.

If the latest version of PHP causes such problems then I though you guys would know and could offer advice??

Thanks,
Kath
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Which webserver, php version and os do you use?
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

That is what we call a "BS Reply". :) It is what a web host will say when they don't have any real idea what the problem is or a solution.

What it sounds like is you may be hitting the maximum memory limit they have allocated for each PHP process. The default is 8 meg. They may have lowered it to allow more processes on the shared server. When you hit that limit PHP usually just quits with an error message. Depending upon how you are processing your feeds you may or may not see the message.

If your page is building the RSS data all at one time and waiting until all of it has processed before sending it to the browser then that may be your problem. That would also explain why sometimes it works and sometimes it doesn't. The times it doesn't work you have more RSS data to process than you have available memory for that PHP process.

It's not a memory leak at all.

If you are compiling all of the RSS feed data into variables before sending it to the client you might want to change your code so it sends EACH RSS message to the client as soon as you process it. That should solve the memory usage problem. But I am speculating since you haven't given any example code for how you are processing the RSS feeds for those pages.
Post Reply