httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)
Date Mon, 23 Mar 2009 14:24:01 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948





--- Comment #10 from Bob MacCallum <r.maccallum@imperial.ac.uk>  2009-03-23 07:23:54
PST ---
Thanks for the reminder.

I've just compiled 2.2.11 with --enable-substitute and installed into a new
directory for the sole purpose of running this test.  I took the HTML from
http://funcgen.vectorbase.org/ExpressionData/ as my test index.html - it's
about 27k (see below for testing on "It works!")

Here's the httpd.conf:

<IfModule substitute_module>
  <Location />  
    AddOutputFilterByType SUBSTITUTE text/html
    Substitute "s|</body>|<!-- hello --></body>|i"
  </Location>
</IfModule>


I'm testing it with a tcsh while loop on wget.

 wc -l logs/access_log ; ps auxwww | grep temp/bin/httpd 
6863 logs/access_log
root      3382  0.0  0.0  13892  1784 ?        Ss   13:56   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3383  0.5  0.0  14432  2264 ?        S    13:56   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3384  0.4  0.0  14432  2256 ?        S    13:56   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3385  0.5  0.0  14432  2256 ?        S    13:56   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3386  0.5  0.0  14432  2256 ?        S    13:56   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3387  0.4  0.0  14432  2256 ?        S    13:56   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3402  0.6  0.0  14432  2208 ?        S    13:56   0:00
/usr/local/apache_dir/temp/bin/httpd -k start


# wc -l logs/access_log ; ps auxwww | grep temp/bin/httpd 
29341 logs/access_log
root      3382  0.0  0.0  13892  1784 ?        Ss   13:56   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3383  0.4  0.0  15652  3468 ?        S    13:56   0:02
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3384  0.4  0.0  15652  3460 ?        S    13:56   0:02
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3385  0.4  0.0  15652  3460 ?        S    13:56   0:02
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3386  0.4  0.0  15652  3460 ?        S    13:56   0:02
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3387  0.4  0.0  15652  3460 ?        S    13:56   0:02
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    3402  0.4  0.0  15652  3412 ?        S    13:56   0:02
/usr/local/apache_dir/temp/bin/httpd -k start


I can clearly see the resource usage growing (albeit slowly).


Here we go again with the AddOutputFilterByType and Substitute lines commented
out:

# wc -l logs/access_log ; ps auxwww | grep temp/bin/httpd 
294 logs/access_log
root      9158  0.0  0.0  13892  1784 ?        Ss   14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    9159  0.0  0.0  14028  1792 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    9160  0.1  0.0  14028  1792 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    9161  0.1  0.0  14028  1792 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    9162  0.1  0.0  14028  1792 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    9163  0.0  0.0  14028  1792 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start


# wc -l logs/access_log ; ps auxwww | grep temp/bin/httpd 
15142 logs/access_log
root      9158  0.0  0.0  13892  1784 ?        Ss   14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    9159  0.4  0.0  14028  1792 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    9160  0.4  0.0  14028  1792 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    9161  0.5  0.0  14028  1792 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    9162  0.5  0.0  14028  1792 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon    9163  0.5  0.0  14028  1792 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   10507  0.4  0.0  14024  1744 ?        S    14:10   0:00
/usr/local/apache_dir/temp/bin/httpd -k start


Memory use is rock solid.  As per my previous report, just commenting the
Substitute line does not prevent the leak.


Interestingly, if I use a trivial "It works!" style index.html, it does not
seem to leak memory:

# wc -l logs/access_log ; ps auxwww | grep temp/bin/httpd 
1318 logs/access_log
root     24651  0.0  0.0  13896  1784 ?        Ss   14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   24652  0.3  0.0  14032  1804 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   24653  0.1  0.0  14032  1804 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   24654  0.2  0.0  14032  1804 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   24655  0.1  0.0  14032  1804 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   24656  0.2  0.0  14032  1804 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   25104  0.1  0.0  14028  1756 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start


# wc -l logs/access_log ; ps auxwww | grep temp/bin/httpd 
15630 logs/access_log
root     24651  0.0  0.0  13896  1784 ?        Ss   14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   24652  0.4  0.0  14032  1804 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   24653  0.4  0.0  14032  1804 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   24654  0.4  0.0  14032  1804 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   24655  0.4  0.0  14032  1804 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   24656  0.3  0.0  14032  1804 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon   25104  0.4  0.0  14028  1756 ?        S    14:15   0:00
/usr/local/apache_dir/temp/bin/httpd -k start


So does this suggest that a page filling more than one filter buffer causes the
problem?

many thanks,
Bob.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message