Php-fastcgi and memory leaks

Grzegorz N. wrote:

On Mon, Mar 31, 2008 at 01:28:22PM +0100, Phillip B Oldham wrote:
Now that is strange. The parent process doesn’t do almost anything.
Maybe running under valgrind will provide some insight (though it is
SLOW).

Actually, thats my error - they were jumping around a lot in top. ps auxf shows the parent process holding steady at 1.7%.

In theory, no. In practice, who knows. It is PHP, after all :wink:

AFAIK, there is no possibility (apart from very nasty hacks) for
extensions to cause gradual increase in parent’s memory usage.
Does the parent process grow at the same rate?

Again, sorry. No, it stays steady. Just the children grow steadily.

Is php-fcgi the only process that exhibits this behaviour? Maybe there’s
something wrong with your system libraries?

Nope, just PHP.

Frankly, I have no idea. If you can reproduce the problem in a test
environment, try running php under “valgrind --leak-check=full”

Thanks, I’ll look into doing that. I’ve not used valgrind before, so
should be fun!

Phillip B Oldham
The Activity People
[email protected] mailto:[email protected]


Policies

This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you in
error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them to
anyone.

This e-mail has been created in the knowledge that Internet e-mail is
not a 100% secure communications medium, and we have taken steps to
ensure that this e-mail and attachments are free from any virus. We must
advise that in keeping with good computing practice the recipient should
ensure they are completely virus free, and that you understand and
observe the lack of security when e-mailing us.

Grzegorz N. wrote:

Yeah, lots of fun. Though if you’re leaking database connections or
something, you might see it e.g. on lsof output. Try disabling
persistent connections (at least temporarily) for the database you’re
using.

We don’t use persistent connections. There’s one connection per request,
which frees when the request finishes. Doesn’t seem to be causing any
problems working that way - the DB’s load is tiny compared to everything
else.

I’ll see what valgrind throws up.

Phillip B Oldham
The Activity People
[email protected] mailto:[email protected]


Policies

This e-mail and its attachments are intended for the above named
recipient(s) only and may be confidential. If they have come to you in
error, please reply to this e-mail and highlight the error. No action
should be taken regarding content, nor must you copy or show them to
anyone.

This e-mail has been created in the knowledge that Internet e-mail is
not a 100% secure communications medium, and we have taken steps to
ensure that this e-mail and attachments are free from any virus. We must
advise that in keeping with good computing practice the recipient should
ensure they are completely virus free, and that you understand and
observe the lack of security when e-mailing us.