Announcement

Collapse
No announcement yet.

ZLib Memory Leak?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ZLib Memory Leak?

    Hi folks,

    Does anyone know anything more about the ZLib memory leak? I've read that PHP 4.04pl1's implementation of ZLib has a memory leak to it.

    I just turned on ob_gzhandler earlier today on my server and had it crash due to it being out of swap space after several hours. My turning on the ob_gzhandler is the only thing I can think of that I've changed so I'm sort of thinking it's the culprit.

    I'm running on FreeBSD 4.3-RC, PHP 4.04pl1, Apache 1.3.19, and ZLib 1.1.3.

    Thanks for any information!
    AikiWeb Aikido Information

  • #2
    yes there is a leak, why not just use vB's inbuilt gzip ?
    :: Always Back Up Forum Database + Attachments BEFORE upgrading !
    :: Nginx SPDY SSL - World Flags Demo [video results]
    :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

    Comment


    • #3
      You might want to look at mod_gzip. I have had it installed for about a week now and it's running great. It can compress anything. mod_php, jsp, html, cgi and of cource mod_perl... and is totally configurable by file or directory.
      http://britishexpats.com/ - British expatriate community

      Comment


      • #4
        Originally posted by eva2000
        yes there is a leak, why not just use vB's inbuilt gzip ?
        I had thought that the gzip support in the control panel basically involved using the zlib routines? Is this a false assumption?

        As for mod_gzip, I'll take a look. I wonder if it's as easy as compiling it out of the /usr/ports/www/mod_gzip directory (using FreeBSD 4.3-RC)...

        Thanks for the information so far.
        AikiWeb Aikido Information

        Comment


        • #5
          Hi folks,

          I went and checked the bug reports on www.php.net and found one for the ob_gzhandler memory leak. I went and grabbed the latest zlib.c (1.69) from their CVS repository and have recompiled mod_php and have reinstated the gzip handling for my Forums...

          Here's to hoping that'll keep the server from crashing again today. Needless to say, I'll be watching the output from top and vmstat for a bit...

          Thanks!
          AikiWeb Aikido Information

          Comment


          • #6
            Just wanted to let people know (if anyone is having the above problem) that getting version 1.69 of zlib and recompiling seems to have worked. I can't say I've noticed any kind of abnormal behavior from my server over the last few days.
            AikiWeb Aikido Information

            Comment


            • #7
              I am using zlib 1.1.3 and don't have any problems with it. I dont use ob_gzhandler directive in php.ini, just using the gzip output set to yes in VB control panel and it works fine. I had my server running for over a week since adding zlib with no problems.

              My server is Apache 1.3.19 on RedHat 6.2 with 1G RAM. I also just had zend cache installed and it all works together nicely.

              I think Apache has its own directive to deal with memorey leak.

              Here is a quote from Apache.org site:

              The MaxRequestsPerChild directive sets the limit on the number of requests that an individual child server process will handle. After MaxRequestsPerChild requests, the child process will die. If MaxRequestsPerChild is 0, then the process will never expire.

              Setting MaxRequestsPerChild to a non-zero limit has two beneficial effects:

              it limits the amount of memory that process can consume by (accidental) memory leakage;
              by giving processes a finite lifetime, it helps reduce the number of processes when the server load reduces.
              On my server I have

              MaxRequestsPerChild 1000
              'beta tester'

              Comment


              • #8
                Originally posted by Mitrofan
                I am using zlib 1.1.3 and don't have any problems with it. I dont use ob_gzhandler directive in php.ini, just using the gzip output set to yes in VB control panel and it works fine. I had my server running for over a week since adding zlib with no problems.
                I took a look at the source code for vBulletin's gzip encoding scheme and it looks like it basically uses zlib's gzencode routine. The memory leak which was in zlib 1.1.3 was in ob_gzhandler and didn't affect gzencode so it looks like if you just use vBulletin's gzip feature, you're safe. The rest of my site, however, also runs under PHP so I wanted to provide compression to those who can use it there so I went and installed the leak-free zlib.c...

                It looks like I have MaxRequestsPerChild set to 0 (infinite), but since the memory leak seems to have been handled, I don't think it'll be necessary to change that...

                Thanks for the information, though!
                AikiWeb Aikido Information

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X