Re: [PHP] Memory leaks with LDAP?
On Thu, Nov 29, 2001 at 09:38:19AM -0700, Darren Gamble wrote: Hey all, Has anyone else had problems with memory leaks using PHP's LDAP functions? Yes I'm running php-4.0.6-7 as a module for apache-1.3.20-16; all Redhat 7.2 RPMs. I posted a message on the PHP bug page recently, but, by reading the posting guidelines on that page it seems that there is a good chance that no one will even look at it. I'm hoping that someone on this list has encountered something similar and would be able to share their resolution. I'm trying to keep track of all LDAP related reports. If yours haven't been attended to, please give me the report number. A number of leaks have been fixed recently, could you test with a recent snapshot from snaps.php.net (or CVS)? I think the fixes will be in 4.1.0 as well, you might test it (or one of the RCs) when it's released shortly. If you still see leaks, please mail me a shortest possible script that demonstrates the problem. Stig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Memory Leaks
-Original Message- From: Paul Strange [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 1:18 PM To: [EMAIL PROTECTED] Subject: [PHP] Memory Leaks When we review the error_log from apache, we see the following alot: zend_hash.c(291) : Freeing 0x0812738C (65 bytes), script=/www/dmp/app/index.php Last leak repeated 152 times Paul, I was hoping to see a response to your post from one of our more technical list members. That's not me, unfortunately. We had a recent bout with this same thing. We have a home-grown database abstraction layer (written in C) that had some memory leaks. As soon as we fixed that code, these Freeing errors went away. That's the sum total of what I know about this, sorry :( Did you configure PHP with the --enable-debug switch? If not, you may want to try it, you may get some additional info into the error log. Good luck. Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Memory Leaks
On Friday 20 July 2001 07:22, Johnson, Kirk wrote: -Original Message- From: Paul Strange [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 1:18 PM To: [EMAIL PROTECTED] Subject: [PHP] Memory Leaks When we review the error_log from apache, we see the following alot: zend_hash.c(291) : Freeing 0x0812738C (65 bytes), script=/www/dmp/app/index.php Last leak repeated 152 times Paul, I was hoping to see a response to your post from one of our more technical list members. That's not me, unfortunately. We had a recent bout with this same thing. We have a home-grown database abstraction layer (written in C) that had some memory leaks. As soon as we fixed that code, these Freeing errors went away. That's the sum total of what I know about this, sorry :( Did you configure PHP with the --enable-debug switch? If not, you may want to try it, you may get some additional info into the error log. Good luck. Kirk Kirk, I checked our configuration with a phpinfo (). --enable-debug is there and part of the configuration. I have checked the error logs again and here is some more information: Start error_log zend_hash.c(291) : Freeing 0x08126FCC (65 bytes), script=/www/dmp/app/index.php Last leak repeated 274 times zend_compile.c(116) : Freeing 0x081230AC (30 bytes), script=/www/dmp/app/index.php Last leak repeated 4 times ./zend_execute.c(378) : Freeing 0x0818B04C (17 bytes), script=/www/dmp/app/index.php zend_variables.c(127) : Actual location (location was relayed) ./zend_execute.c(375) : Freeing 0x08121E44 (12 bytes), script=/www/dmp/app/index.php ./zend_execute.c(1517) : Freeing 0x081882BC (12 bytes), script=/www/dmp/app/index.php Last leak repeated 7 times ./zend_execute.c(1625) : Freeing 0x081556E4 (12 bytes), script=/www/dmp/app/index.php zend_hash.c(461) : Freeing 0x0818B094 (44 bytes), script=/www/dmp/app/index.php Last leak repeated 5 times zend_hash.c(202) : Freeing 0x0812280C (20 bytes), script=/www/dmp/app/index.php Last leak repeated 12 times ./zend_execute.c(1536) : Freeing 0x0818C4F4 (48 bytes), script=/www/dmp/app/index.php Last leak repeated 3 times zend_API.c(313) : Freeing 0x081581FC (6 bytes), script=/www/dmp/app/index.php Last leak repeated 17 times zend_API.c(309) : Freeing 0x081581BC (12 bytes), script=/www/dmp/app/index.php Last leak repeated 17 times php_mysql.c(1389) : Freeing 0x0817B044 (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) ./zend_execute.c(140) : Freeing 0x08169974 (48 bytes), script=/www/dmp/app/index.php zend_variables.c(150) : Actual location (location was relayed) Last leak repeated 1 time zend_hash.c(433) : Freeing 0x081555C4 (16 bytes), script=/www/dmp/app/index.php zend_hash.c(427) : Freeing 0x08123B34 (35 bytes), script=/www/dmp/app/index.php Last leak repeated 2 times file.c(1922) : Freeing 0x0816A0B4 (9 bytes), script=/www/dmp/app/index.php zend_API.c(499) : Freeing 0x08160B3C (10 bytes), script=/www/dmp/app/index.php Last leak repeated 2 times zend_API.c(495) : Freeing 0x08122304 (12 bytes), script=/www/dmp/app/index.php Last leak repeated 2 times reg.c(534) : Freeing 0x08179EAC (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) ./zend_execute.c(386) : Freeing 0x08121E84 (12 bytes), script=/www/dmp/app/index.php main.c(1083) : Freeing 0x08176DF4 (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) main.c(1082) : Freeing 0x081222C4 (12 bytes), script=/www/dmp/app/index.php main.c(1137) : Freeing 0x0814561C (12 bytes), script=/www/dmp/app/index.php main.c(1119) : Freeing 0x081619B4 (47 bytes), script=/www/dmp/app/index.php main.c(1116) : Freeing 0x081609BC (12 bytes), script=/www/dmp/app/index.php main.c(1104) : Freeing 0x0812447C (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) main.c(1103) : Freeing 0x08160A5C (12 bytes), script=/www/dmp/app/index.php php_variables.c(169) : Freeing 0x081608BC (12 bytes), script=/www/dmp/app/index.php Last leak repeated 111 times string.c(1964) : Freeing 0x08122E2C (29 bytes), script=/www/dmp/app/index.php Last leak repeated 111 times main.c(967) : Freeing 0x081609FC (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) main.c(966) : Freeing 0x081641BC (12 bytes), script=/www/dmp/app/index.php php_variables.c(231) : Freeing 0x0814A0D4 (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) Last leak repeated 1 time php_variables.c(230) : Freeing 0x0817092C (12 bytes), script=/www/dmp/app/index.php Last leak repeated 1 time main.c(1061) : Freeing 0x0814A9CC (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) main.c(1060) : Freeing 0x08166254 (12 bytes), script=/www/dmp/app/index.php zend_ptr_stack.c(29) :
Re: [PHP] Memory Leaks
Paul, First off, this is definitely not what's killing your server. The reason for this is simple - the leak reports you see in the error log are only for debug purposes. PHP takes care of these leaks automatically, and frees these blocks. Such leaks are not a good thing (they imply there's an implementation bug in PHP), but thanks to PHP's safety net, they're not a very critical thing either. Secondly, have you tried using PHP 4.0.6? Its memory handling should be significantly better than any of the previous PHP 4.0 versions. Thirdly, in order to fix the leaks that happen on your web site, we'd need the smallest self-contained script (or set of scripts) that causes these messages to display. Looking at the code snippet that you've pasted, my guess is that the cause is not there, but in the required decision.php file, or in an auto prepended/appended file, that you might have. If you can take these files as a starting point, then cut them down as much as you can, removing any external dependencies, such as database connectivity (while checking at every step of the way that the leak still occurs) - chances are we'll be able to fix it quite quickly. Zeev At 18:44 20/07/2001, Paul Strange wrote: On Friday 20 July 2001 07:22, Johnson, Kirk wrote: -Original Message- From: Paul Strange [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 1:18 PM To: [EMAIL PROTECTED] Subject: [PHP] Memory Leaks When we review the error_log from apache, we see the following alot: zend_hash.c(291) : Freeing 0x0812738C (65 bytes), script=/www/dmp/app/index.php Last leak repeated 152 times Paul, I was hoping to see a response to your post from one of our more technical list members. That's not me, unfortunately. We had a recent bout with this same thing. We have a home-grown database abstraction layer (written in C) that had some memory leaks. As soon as we fixed that code, these Freeing errors went away. That's the sum total of what I know about this, sorry :( Did you configure PHP with the --enable-debug switch? If not, you may want to try it, you may get some additional info into the error log. Good luck. Kirk Kirk, I checked our configuration with a phpinfo (). --enable-debug is there and part of the configuration. I have checked the error logs again and here is some more information: Start error_log zend_hash.c(291) : Freeing 0x08126FCC (65 bytes), script=/www/dmp/app/index.php Last leak repeated 274 times zend_compile.c(116) : Freeing 0x081230AC (30 bytes), script=/www/dmp/app/index.php Last leak repeated 4 times ./zend_execute.c(378) : Freeing 0x0818B04C (17 bytes), script=/www/dmp/app/index.php zend_variables.c(127) : Actual location (location was relayed) ./zend_execute.c(375) : Freeing 0x08121E44 (12 bytes), script=/www/dmp/app/index.php ./zend_execute.c(1517) : Freeing 0x081882BC (12 bytes), script=/www/dmp/app/index.php Last leak repeated 7 times ./zend_execute.c(1625) : Freeing 0x081556E4 (12 bytes), script=/www/dmp/app/index.php zend_hash.c(461) : Freeing 0x0818B094 (44 bytes), script=/www/dmp/app/index.php Last leak repeated 5 times zend_hash.c(202) : Freeing 0x0812280C (20 bytes), script=/www/dmp/app/index.php Last leak repeated 12 times ./zend_execute.c(1536) : Freeing 0x0818C4F4 (48 bytes), script=/www/dmp/app/index.php Last leak repeated 3 times zend_API.c(313) : Freeing 0x081581FC (6 bytes), script=/www/dmp/app/index.php Last leak repeated 17 times zend_API.c(309) : Freeing 0x081581BC (12 bytes), script=/www/dmp/app/index.php Last leak repeated 17 times php_mysql.c(1389) : Freeing 0x0817B044 (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) ./zend_execute.c(140) : Freeing 0x08169974 (48 bytes), script=/www/dmp/app/index.php zend_variables.c(150) : Actual location (location was relayed) Last leak repeated 1 time zend_hash.c(433) : Freeing 0x081555C4 (16 bytes), script=/www/dmp/app/index.php zend_hash.c(427) : Freeing 0x08123B34 (35 bytes), script=/www/dmp/app/index.php Last leak repeated 2 times file.c(1922) : Freeing 0x0816A0B4 (9 bytes), script=/www/dmp/app/index.php zend_API.c(499) : Freeing 0x08160B3C (10 bytes), script=/www/dmp/app/index.php Last leak repeated 2 times zend_API.c(495) : Freeing 0x08122304 (12 bytes), script=/www/dmp/app/index.php Last leak repeated 2 times reg.c(534) : Freeing 0x08179EAC (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) ./zend_execute.c(386) : Freeing 0x08121E84 (12 bytes), script=/www/dmp/app/index.php main.c(1083) : Freeing 0x08176DF4 (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) main.c(1082) : Freeing 0x081222C4 (12 bytes), script=/www/dmp/app/index.php main.c(1137) : Freeing 0x0814561C (12 bytes), script=/www/dmp/app/index.php main.c(1119) : Freeing 0x081619B4 (47 bytes),
Re: [PHP] Memory Leaks
Zeev, Thank you for taking the time out of you busy schedule to help me. We have not been able to get 4.0.6 to work on the server. We can compile fine, but when we perform a check with phpinfo (), the server reports php-4.0.4pl1. We have configured PHP as a module to apache but do not know how to get apache to recognize the newer version. We would like to solve these memory leaks as best as possible. We have not been able to duplicate the leaks on our test server which has made trouble shooting much harder. It appears as though the leak is directly related to how much load the server has on it. Are there any good load tools out there that we can use to duplicate this? We believe the leaks are related to database calls. The database is on a seperate server, and the abstraction layer was written in php. Any directions you could point us in would be greatly appreciated. -- Paul Strange Lead Programmer Level 67 LC --- eMail: [EMAIL PROTECTED] Office: 801.486.4686 Fax: 801.994.0467 On Friday 20 July 2001 08:22, Zeev Suraski wrote: Paul, First off, this is definitely not what's killing your server. The reason for this is simple - the leak reports you see in the error log are only for debug purposes. PHP takes care of these leaks automatically, and frees these blocks. Such leaks are not a good thing (they imply there's an implementation bug in PHP), but thanks to PHP's safety net, they're not a very critical thing either. Secondly, have you tried using PHP 4.0.6? Its memory handling should be significantly better than any of the previous PHP 4.0 versions. Thirdly, in order to fix the leaks that happen on your web site, we'd need the smallest self-contained script (or set of scripts) that causes these messages to display. Looking at the code snippet that you've pasted, my guess is that the cause is not there, but in the required decision.php file, or in an auto prepended/appended file, that you might have. If you can take these files as a starting point, then cut them down as much as you can, removing any external dependencies, such as database connectivity (while checking at every step of the way that the leak still occurs) - chances are we'll be able to fix it quite quickly. Zeev At 18:44 20/07/2001, Paul Strange wrote: On Friday 20 July 2001 07:22, Johnson, Kirk wrote: -Original Message- From: Paul Strange [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 19, 2001 1:18 PM To: [EMAIL PROTECTED] Subject: [PHP] Memory Leaks When we review the error_log from apache, we see the following alot: zend_hash.c(291) : Freeing 0x0812738C (65 bytes), script=/www/dmp/app/index.php Last leak repeated 152 times Paul, I was hoping to see a response to your post from one of our more technical list members. That's not me, unfortunately. We had a recent bout with this same thing. We have a home-grown database abstraction layer (written in C) that had some memory leaks. As soon as we fixed that code, these Freeing errors went away. That's the sum total of what I know about this, sorry :( Did you configure PHP with the --enable-debug switch? If not, you may want to try it, you may get some additional info into the error log. Good luck. Kirk Kirk, I checked our configuration with a phpinfo (). --enable-debug is there and part of the configuration. I have checked the error logs again and here is some more information: Start error_log zend_hash.c(291) : Freeing 0x08126FCC (65 bytes), script=/www/dmp/app/index.php Last leak repeated 274 times zend_compile.c(116) : Freeing 0x081230AC (30 bytes), script=/www/dmp/app/index.php Last leak repeated 4 times ./zend_execute.c(378) : Freeing 0x0818B04C (17 bytes), script=/www/dmp/app/index.php zend_variables.c(127) : Actual location (location was relayed) ./zend_execute.c(375) : Freeing 0x08121E44 (12 bytes), script=/www/dmp/app/index.php ./zend_execute.c(1517) : Freeing 0x081882BC (12 bytes), script=/www/dmp/app/index.php Last leak repeated 7 times ./zend_execute.c(1625) : Freeing 0x081556E4 (12 bytes), script=/www/dmp/app/index.php zend_hash.c(461) : Freeing 0x0818B094 (44 bytes), script=/www/dmp/app/index.php Last leak repeated 5 times zend_hash.c(202) : Freeing 0x0812280C (20 bytes), script=/www/dmp/app/index.php Last leak repeated 12 times ./zend_execute.c(1536) : Freeing 0x0818C4F4 (48 bytes), script=/www/dmp/app/index.php Last leak repeated 3 times zend_API.c(313) : Freeing 0x081581FC (6 bytes), script=/www/dmp/app/index.php Last leak repeated 17 times zend_API.c(309) : Freeing 0x081581BC (12 bytes), script=/www/dmp/app/index.php Last leak repeated 17 times php_mysql.c(1389) : Freeing 0x0817B044 (48 bytes), script=/www/dmp/app/index.php zend_API.c(188) : Actual location (location was relayed) ./zend_execute.c(140) : Freeing 0x08169974 (48 bytes),
Re: [PHP] Memory Leaks
The database is MySQL. On Friday 20 July 2001 10:15, Rasmus Lerdorf wrote: Thank you for taking the time out of you busy schedule to help me. We have not been able to get 4.0.6 to work on the server. We can compile fine, but when we perform a check with phpinfo (), the server reports php-4.0.4pl1. We have configured PHP as a module to apache but do not know how to get apache to recognize the newer version. That's a basic you are doing something silly problem. Delete all instances of libphp4.so on your server. Then in your PHP directory do a rm config.cache; make clean; ./configure --with...; make; make install If you follow these steps you will see PHP 4.0.6 (or alternatively your server won't start at all because it is looking for libphp4.so in the wrong place) Unless of course you built the static module version of PHP (see if your phpinfo() output says --with-apache or --with-apxs in the configure flags section). If it says --with-apxs it is a dynamic module, if it says --with-apache it is static. If it is static you will need to rebuild your apache httpd binary. We would like to solve these memory leaks as best as possible. We have not been able to duplicate the leaks on our test server which has made trouble shooting much harder. It appears as though the leak is directly related to how much load the server has on it. Are there any good load tools out there that we can use to duplicate this? We believe the leaks are related to database calls. The database is on a seperate server, and the abstraction layer was written in php. Any directions you could point us in would be greatly appreciated. Which database? -Rasmus -- Paul Strange VP of Software Development Level 67 LC --- eMail: [EMAIL PROTECTED] Office: 801.486.4686 Fax: 801.994.0467 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]