Memory leak ~ 8k occurs every time I run PROPFIND webdav method when mod_deflate is activated, e.g. if client issued Accept-Encode: gzip header. PROPFIND was used against a quite big directory (~400files) and the responce stream was ~ 400kB (after de-compression). Problem does not appear if either mod_deflate is not loaded or if "Accept- Encode: gzip" is not used. Following configuration directives are in my httpd.conf: #stripped off common top LoadModule deflate_module modules/mod_deflate.so NameVirtualHost localhost:80 NameVirtualHost localhost:801 <VirtualHost localhost:80> </VirtualHost> <VirtualHost localhost:801> DAVLockDB logs/DavLock <Directory "D:/apa2_0_43/htdocs"> SetInputFilter DEFLATE SetOutputFilter DEFLATE DAV On <Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> AuthName "Fx" AuthType Basic AuthUserFile logs/passw Require user dmitri </Limit> </Directory> </VirtualHost>
A memory leak was fixed after 2.0.43. Please download the latest mod_deflate (from http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/filters/mod_deflate.c) or wait for 2.0.44, then report back. Thanks!
I've checked. Yes indeed the bug went away. But please don't close it immediately. By learning sources I see that there are some conditions when some additional leaks may occur again. mod_deflate does not always make a paired call to inflateEnd() after inflateInit2() was called. It make a big concern that the leak can be reproduced with for example a trimmed compressed part. Remember that after inflateInit2() was called zlib may allocate up to 256kb of memory and releases all in inflateEnd() only.
I checked with a "trimmed" (e.g. wrong) compressed request. As expected Apache gets HTTP/1.1 400. But as predicted a memory leak occurs too. Approx. 48kB for a request. Conditions: mod_deflate mod_dav mod_dav_fs installed. PROPFIND request made with Content-encoding: gzip and content is too short (trimmed) for example just 11 bytes. Gzipped content can never be less than 18 bytes: #####Headers: PROPFIND / HTTP/1.1 Content-Encoding: gzip Content-Type: text/xml; charset="utf-8" Content-Length: 11 Host: localhost:801 Accept: text/html, */* Accept-Encoding: gzip User-Agent: Mozilla/3.0 (compatible; DD Library) Depth: 1 #####Content - gzipped but trimmed, hex dump 0x1F 0x8B 0x08 0x00 0x00 0x00 0x00 0x00 0x00 0x0B 0xB3 My investigation showed that a call to inflateEnd() is missed. Occurs when conditions above are met.
Should be fixed in modules/filters/mod_deflate.c r1.30 Thanks for using Apache HTTP Server!