Re: [PHP4BETA] mem leak?
| From: | Gaylord Aulke | Date: | Tue, 14 Mar 2000 16:18:13 +0000 |
| Subject: | Re: [PHP4BETA] mem leak? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-16802@lists.php.net to get a copy of this message | ||
the problem is still here. i can reproduce it with another machine
by installing the same software components: apache 1.3.11, php4 CVS,
adabas-d.
maybe it's not odbc but session handling that loses the memory?
gaylord aulke
Andi Gutmans wrote:
> Please edit zend_fast_cache.h in the Zend/ directory and a line after
> #define _ZEND_FAST_CACHE_H
> add
> #define ZEND_ENABLE_FAST_CACHE 0
> Also edit zend_alloc.h and change
> MAX_CACHED_MEMORY to 1
> and
> MAX_CACHED_ENTRIES to 1
>
> See if this changes anything.
>
> Andi
>
> On Mon, 13 Mar 2000, Gaylord Aulke wrote:
>
> > hi,
> >
> > we tested a little bit more today and found the following strange phenomenon:
> > we start apache and every httpd uses 0.6% of the available memory (according
> > to "top").
> >
> > while running, this percentage increases step by step. after 6 hours, every httpd
> > uses 1.2% of the available memory. httpd's are started and stopped correctly.
> > we have a minimum of 20 servers, 20 min.spare and 40 max. spare. the number
> > of httpds changes frequently. the size of newly started httpds increases as
> > said above (1.4% now).
> >
> > in my opinion the amount of shared memory the apache processes use increases.
> > does this make sense? can it be PHP?
> >
> > regards,
> > gaylord aulke
> >
> >
> >
> >
> > Andi Gutmans wrote:
> >
> > > Sound strange. There are some inter-request cache's but I don't think they
> > > are 500KB of size. Although if the size doesn't grow this might be it. Did
> > > you compile with --disable-debug?
> > >
> > > Andi
> > >
> > > At 11:35 PM 3/12/00 +0100, Gaylord Aulke wrote:
> > > >we are currently analyzing the system to track down the cause of the
> > > >memory leak. could also be syslogd or some other component.
> > > >
> > > >the system has an average of 96 HTTPDs open but sometimes this number
> > > >increases to 230 for a few seconds.
> > > >
> > > >the machine has 768MB RAM. after apache is running for a few minutes, it
> > > >starts
> > > >allocating more and more memory. 500-1000 KB in 5 seconds are allocated
> > > >and not freed until apache is shut down.
> > > >
> > > >we switched back to PHP3 for now but start our 3rd PHP4-Approach
> > > >tomorrow.
> > > >maybe we have more info then...
> > > >
> > > >gaylord aulke
> > > >agi, stuttgart, germany
> > > >
> > > >PS: (the site's name is
> > > >http://www.knowone.de)
> > > >
> > > >Andi Gutmans wrote:
> > > > >
> > > > > Well I'm not saying it isn't PHP but the fact that it's Beta
> > > > > doesn't mean
> > > > > much. We're actually quite close to a release candidate within a few
> > > > > weeks.
> > > > > PHP frees every requests memory automatically (even if the internal engine
> > > > > leaks) at the end of each request. Of course there could be a leak
> > > > > somewhere as there are some places which don't use the special memory
> > > > > manager but it would probably be a pretty isolated case.
> > > > > The only way we can debug your problem is if we have enough information as
> > > > > to when it happens. I'm aware it is hard for you to track this problem
> > > > down.
> > > > > By the way, do the httpd's keep on growing and growing? Or do they
> > > > > stabilize at a certain size?
> > > > >
> > > > > Andi
> > > > >
> > > > > At 02:20 AM 3/11/00 +0100, Gaylord Aulke wrote:
> > > > > >hmmm. i try to find out which script causes the mem leak. it seems to
> > > > > >happen only with concurrent request. we had no probs with our
> > > > > >inhouse test system. i am not even sure if it is php that causes
> > > > > >the memory loss but it's the only beta-software on the system...
> > > > > >
> > > > > >persistent connections did not work with my system configuration,
> > > > > >so i use regular connects.
> > > > > >
> > > > > >gaylord aulke
> > > > > >
> > > > > >
> > > > > >Andi Gutmans wrote:
> > > > > > >
> > > > > > > As the script memory is completely freed after each request this
> > > > might have
> > > > > > > something to do with the ODBC/Adabas support you're using.
> > > > > > > Are you using persistent connections?
> > > > > > > Is there any chance you can find the script which is causing this
> > > > trouble
> > > > > > > and cut it down as much as possible?
> > > > > > >
> > > > > > > Andi
> > > > > > >
> > > > > > > At 11:35 PM 3/10/00 +0100, Gaylord Aulke wrote:
> > > > > > > >here my report:
> > > > > > > >we compiled and built the current cvs and after that, the
> > > > > > > >error did
> > > > > > not occur
> > > > > > > >anymore.
> > > > > > > >the memory leak that brings my server down has increased by
> > > > > > > >at least a
> > > > > > > >factor of
> > > > > > > >two after installing the new build.
> > > > > > > >
> > > > > > > >we switched back to php3.0.15 for now.
> > > > > > > >
> > > > > > > >gaylord aulke
> > > > > > > >
> > > > > > > >Gaylord Aulke wrote:
> > > > > > > >
> > > > > > > > > Okay, we are working on it.
> > > > > > > > > in the meantime we changed the script so that it frees
> > > > > > > > > all
> > > > > > odbc-results and
> > > > > > > > > closes the connection but the error still occurs.
> > > > > > > > >
> > > > > > > > > but the memory leak is much bigger than reported by
> > > > > > > > > this error
> > > > message.
> > > > > > > > > i think we currently have 100-200 php-requests/minute
> > > > > > > > > and lose
> > > > > > 500KB every
> > > > > > > > > 5-6 seconds.
> > > > > > > > >
> > > > > > > > > if you need more info to locate the problem, please
> > > > > > > > > send me an
> > > > email. i
> > > > > > > > > can do some checks now on the running system with 280
> > > > > > > > > users on it.
> > > > > > > > >
> > > > > > > > > regards,
> > > > > > > > > gaylord aulke
> > > > > > > > >
> > > > > > > > > Andi Gutmans wrote:
> > > > > > > > >
> > > > > > > > > > Can you please try and update your Zend CVS tree
> > > > > > > > > > and see if I
> > > > > > managed to
> > > > > > > > > > fix the problem. I think I have found a leak but
> > > > > > > > > > I'm not sure
> > > > this is
> > > > > > > > what
> > > > > > > > > > effected you.
> > > > > > > > > >
> > > > > > > > > > Andi
> > > > > > > > > >
> > > > > > > > > > At 10:21 PM 3/10/00 +0100, Gaylord Aulke wrote:
> > > > > > > > > > >hi,
> > > > > > > > > > >
> > > > > > > > > > >we have exactly the same problem. our apache
> > > > > > > > > > >keeps leaking
> > > > > > > > > > >memory. 500 MB in 2 Hours! And then the system
> > > > > > > > > > >swaps
> > > > > > > > > > >and dies.
> > > > > > > > > > >
> > > > > > > > > > >PHP4, CVS-Version 03/10/2000
> > > > > > > > > > >
> > > > > > > > > > >message from error-log:
> > > > > > > > > > >zend_operators.c(741) : Freeing 0x08399DFC (3
> > > > > > > > > > >bytes),
> > > > > > > > > >
> > > > > > > > > > >>script=/home/www/knowone4/daheim/anzeige_aufgeben.php
> > > > > > > > > > >
> > > > > > > > > > >this message arrises every 20 seconds.
> > > > > > > > > > >
> > > > > > > > > > >we are using ODBC/ADABAS and sessions. the
> > > > > > > > > > >same scripts
> > > > > > > > > > >work fine with the same apache and php3.
> > > > > > > > > > >
> > > > > > > > > > >anyone got an idea?
> > > > > > > > > > >
> > > > > > > > > > >btw: we are not freeing our odbc-results and
> > > > > > > > > > >connections. can
> > > > > > > > > > >this be the problem?
> > > > > > > > > > >
> > > > > > > > > > >regards,
> > > > > > > > > > >gaylord aulke
> > > > > > > > > > >
> > > > > > > > > > >Teodor Cimpoesu wrote:
> > > > > > > > > > >
> > > > > > > > > > > > ./zend_execute.c(1695) : Freeing
> > > > > > > > > > > > 0x0818C8AC (12 bytes),
> > > > > > > > > > > >
> > > > > > > > > > > > script=/opt/apache.fuel/htdocs/phorum/index.php
> > > > > > > > > > > > ./zend_execute.c(1695) : Freeing
> > > > > > > > > > > > 0x0814C20C (12 bytes),
> > > > > > > > > > > >
> > > > > > > > > > > > script=/opt/apache.fuel/htdocs/phorum/index.php
> > > > > > > > > > > > ./zend_execute.c(1695) : Freeing
> > > > > > > > > > > > 0x08154DD4 (12 bytes),
> > > > > > > > > > > >
> > > > > > > > > > > > script=/opt/apache.fuel/htdocs/phorum/index.php
> > > > > > > > > > > > ./zend_execute.c(1695) : Freeing
> > > > > > > > > > > > 0x0815E05C (12 bytes),
> > > > > > > > > > > >
> > > > > > > > > > > > script=/opt/apache.fuel/htdocs/phorum/index.php
> > > > > > > > > > > > (CVS snapshot of few minutes ago)
> > > > > > > > > > > >
> > > > > > > > > > > > The page producing this is the index.php
> > > > > > > > > > > > from phorum3.0.8
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > CIMPOESU Teodor, Web Programmer
> > > > > > > > > > > > @ DIGICOM S.A. Bucharest, Romania
> > > > > > > > > > > > @ Internet, site development
> > > > > > > > > > > > @ see
> > > > > > > > > > > > http://internet.digiro.net/
> > > > > > > > > > > >
> > > > > > > > > > > > --
> > > > > > > > > > > > PHP 4.0 Beta Mailing List <µ-Ü”
> > > > > > > > > > > > ø�
p˜Ô\›�http://www.php.net/version4/>
> > > > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > > > php4beta-unsubscribe@lists.php.net
> > > > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > > > php4beta-help@lists.php.net
> > > > > > > > > > > > To contact the list administrators,
> > > > > > > > > > > > e-mail:
> > > > > > > > php4beta-admin@lists.php.net
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >--
> > > > > > > > > > >PHP 4.0 Beta Mailing List
> > > > > > > > > > ><http://www.php.net/version4/>
> > > > > > > > > > >To unsubscribe, e-mail:
> > > > > > > > > > >php4beta-unsubscribe@lists.php.net
> > > > > > > > > > >For additional commands, e-mail:
> > > > > > > > > > >php4beta-help@lists.php.net
> > > > > > > > > > >To contact the list administrators, e-mail:
> > > > > > php4beta-admin@lists.php.net
> > > > > > > > > >
> > > > > > > > > > ---
> > > > > > > > > > Andi Gutmans <andi@zend.com>
> > > > > > > > > >
> > > > > > > > > > http://www.zend.com/
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > PHP 4.0 Beta Mailing List
> > > > > > > > > > <http://www.php.net/version4/>
> > > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > > php4beta-unsubscribe@lists.php.net
> > > > > > > > > > For additional commands, e-mail:
> > > > > > > > > > php4beta-help@lists.php.net
> > > > > > > > > > To contact the list administrators, e-mail:
> > > > > > php4beta-admin@lists.php.net
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > PHP 4.0 Beta Mailing List
> > > > > > > > > <http://www.php.net/version4/>
> > > > > > > > > To unsubscribe, e-mail:
> > > > > > > > > php4beta-unsubscribe@lists.php.net
> > > > > > > > > For additional commands, e-mail:
> > > > > > > > > php4beta-help@lists.php.net
> > > > > > > > > To contact the list administrators, e-mail:
> > > > > > php4beta-admin@lists.php.net
> > > > > > >
> > > > > > > ---
> > > > > > > Andi Gutmans <andi@zend.com>
> > > > > > > http://www.zend.com/
> > > > >
> > > > > ---
> > > > > Andi Gutmans <andi@zend.com>
> > > > > http://www.zend.com/
> > >
> > > ---
> > > Andi Gutmans <andi@zend.com>
> > > http://www.zend.com/
> >