You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/05/07 14:11:14 UTC

DO NOT REPLY [Bug 44948] New: mod_substitute has a memory leak

https://issues.apache.org/bugzilla/show_bug.cgi?id=44948

           Summary: mod_substitute has a memory leak
           Product: Apache httpd-2
           Version: 2.2.8
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Other Modules
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: karoshi@gmx.net


Using Apache 2.2.8 on WinXP, mod_substitute doesn't give back all used memory.


Configuration:
AddOutputFilter SUBSTITUTE html
Substitute "s|foo|bar|"


Create a file that contains the word "foo" a few times (I used a total filesize
of 4 MB).


Use ab to execute some requests:

./ab -n 200 -c 1 http://localhost:8082/foo.html
Memory usage raises from 7 MB to ~12MB, stays there.

./ab -n 200 -c 25 http://localhost:8082/foo.html
Memory usage raises from 7 MB to ~66MB, stays there.

./ab -n 200 -c 100 http://localhost:8082/foo.html
Memory usage raises from 7 MB to ~156MB, stays there.


-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


Basant Kumar Kukreja <ba...@sun.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |basant.kukreja@sun.com




--- Comment #5 from Basant Kumar Kukreja <ba...@sun.com>  2008-09-08 17:18:04 PST ---
I think, there is something missing in our understanding. I also find this
leak.

I configured apache with worker mpm using 1 thread.

Then I generated a large file of 300 mb which have repeatitive substituttion :

httpd.conf snippet :

Alias /testsub/ "/usr/local/apache2/htdocs2/testsub/"
LoadModule substitute_module modules/mod_substitute.so
<Directory "/usr/local/apache2/htdocs2/testsub">
    Options FollowSymLinks
    AllowOverride None
    AddOutputFilter SUBSTITUTE html
    Substitute "s/.*one.*two/1 2/"
</Directory>

After every request, process size increases. I used mdb to find the leak :

CACHE     LEAKED   BUFCTL CALLER
080e9810     173 081d7278 libapr-1.so.0.4.0`allocator_alloc+0x2e3
080e9810       2 081d7020 libapr-1.so.0.4.0`allocator_alloc+0x2e3
------------------------------------------------------------------------
   Total     175 buffers, 1612800 bytes

umem_alloc_9216 leak: 173 buffers, 9216 bytes each, 1594368 bytes total
            ADDR          BUFADDR        TIMESTAMP           THREAD
                            CACHE          LASTLOG         CONTENTS
         81d7278          81da480    3524112f1e797                3
                          80e9810                0                0
                 libumem.so.1`umem_cache_alloc_debug+0x14f
                 libumem.so.1`umem_cache_alloc+0x180
                 libumem.so.1`umem_alloc+0xc5
                 libumem.so.1`malloc+0x27
                 libapr-1.so.0.4.0`allocator_alloc+0x2e3
                 libapr-1.so.0.4.0`apr_pool_create_ex+0x77
                 mod_substitute.so`do_pattmatch+0xbb
                 mod_substitute.so`substitute_filter+0x53b
                 ap_pass_brigade+0x9e
                 default_handler+0x461
                 ap_run_handler+0x51
                 ap_invoke_handler+0x15b
                 ap_process_async_request+0x6a
                 ap_process_request+0x1a
                 ap_process_http_connection+0x8e

If you see the do_pattmatch then the leak is there when it create pool.
    apr_pool_create(&tpool, tmp_pool);

After the end of do_pattmatch, pool is safely deleted.
    apr_pool_destroy(tpool);

The question is why the memory is not recycled properly.

Now when I send a single request, it leaks addtional 165 mallocs

So here is the number of malloc leaks reported by mdb :
Leak after initial few requests : 334
After one more request (of 30m size) : 499 
After one more request (of 30m size) : 663
After 10 more request (of 30m size) : 4313

The above pattern keeps increasing linearly with 164 leaks per request.

Mod_substitute code looks ok to me but because of some reason memory recycle
is not happening properly.

But for sure, it seems to be a real issue.


-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


Dan Poirier <po...@pobox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|poirier@pobox.com           |




--- Comment #12 from Dan Poirier <po...@pobox.com>  2009-03-23 07:39:34 PST ---
That's definitely helpful. I'll try again with a larger test file.

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948





--- Comment #19 from Ruediger Pluem <rp...@apache.org>  2009-03-24 04:31:27 PST ---
Patch committed to trunk in r757741 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=757741 )

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948





--- Comment #15 from Ruediger Pluem <rp...@apache.org>  2009-03-23 14:25:34 PST ---
(In reply to comment #13)
> Created an attachment (id=23400)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23400) [details]
> Proposed fix against 2.2.11
> 
> I was able to reproduce the problem.  The attached patch seemed to solve the
> problem; it looked as though a bucket was leaking there.  Can you try it and
> see if it works for you?  It's against 2.2.11.

While I agree with your patch that 
apr_bucket_delete is better than APR_BUCKET_REMOVE and avoids a leak in theory
I currently fail to see that we execute this code section often enough to
produce a leak in practice. To be honest we should only hit this code section
rarely.

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948





--- Comment #13 from Dan Poirier <po...@pobox.com>  2009-03-23 11:15:16 PST ---
Created an attachment (id=23400)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23400)
Proposed fix against 2.2.11

I was able to reproduce the problem.  The attached patch seemed to solve the
problem; it looked as though a bucket was leaking there.  Can you try it and
see if it works for you?  It's against 2.2.11.

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


Bob MacCallum <r....@imperial.ac.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW




--- Comment #11 from Bob MacCallum <r....@imperial.ac.uk>  2009-03-23 07:25:07 PST ---
forgot to change status to "NEW"

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948





--- Comment #18 from Ruediger Pluem <rp...@apache.org>  2009-03-24 04:01:20 PST ---
(In reply to comment #16)

> 
> Are you implying that there is significant overhead with apr_bucket_delete()?

No. I was implying that this patch might not be the fix for your leak. But
apparently I was wrong and it fixes your leak.

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948





--- Comment #16 from Bob MacCallum <r....@imperial.ac.uk>  2009-03-24 02:56:37 PST ---
(In reply to comment #15)
> While I agree with your patch that 
> apr_bucket_delete is better than APR_BUCKET_REMOVE and avoids a leak in theory
> I currently fail to see that we execute this code section often enough to
> produce a leak in practice. To be honest we should only hit this code section
> rarely.

But we've shown there's a leak.  I've shown that it wasn't too bad when
processing smallish content, but others have had httpd swapping out with larger
content.  If our project deploys the substitute filter, we will need it to be
rock solid on content from a few bytes up to several megabytes.

Are you implying that there is significant overhead with apr_bucket_delete()?

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


Dan Poirier <po...@pobox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEEDINFO




--- Comment #9 from Dan Poirier <po...@pobox.com>  2009-03-23 05:23:37 PST ---
Waiting for recreate on 2.2.11, more details.

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


Dan Poirier <po...@pobox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |poirier@pobox.com




--- Comment #8 from Dan Poirier <po...@pobox.com>  2009-03-02 05:19:38 PST ---
I was unable to reproduce this.

I built httpd 2.2.11 on Ubuntu 8.10, same configuration as above:

"./configure" \
"--prefix=/home/poirier/src/httpd-2.2.11/built" \
"--enable-proxy" \
"--enable-proxy-ajp" \
"--enable-rewrite" \
"--enable-substitute"

I configured it to do a simple substitution, to use keepalive, and to have very
long-lived processes:

<Location />
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|It works|Hi Dan|i"
</Location>

# Keepalive forever
MaxKeepAliveRequests 0

# Using prefork
<IfModule mpm_prefork_module>
    StartServers          1
    MinSpareServers       1
    MaxSpareServers       20
    MaxClients            10
    MaxRequestsPerChild   0
</IfModule>

Then I used ab to run millions of requests.  

bin/ab -c 5 -k -n 100000 http://localhost/
(repeatedly)

According to ps, VSZ and RSS for the child processes plateaued early and never
changed again.

I did find that the "ab" utility gobbled memory and to get through millions of
requests, I had to invoke it in smaller batches or ab ended up triggering
swapping.  But httpd's memory usage never budged.

Questions for those who have reported this problem:

- Have you tried it on 2.2.11?   (Run a million requests or so, not 10 or 20. 
If memory usage goes up steadily, there's a leak; if it settles down to a
steady size, there's not.)

- If you're still seeing it on 2.2.11, can you provide the exact configuration
you're using - configure command (build/config.nice), httpd.conf (conf/* and
conf/*/*), even the web page being substituted against?  Try to narrow it down
to the simplest configuration that still shows the problem, of course.

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


Bob MacCallum <r....@imperial.ac.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.maccallum@imperial.ac.uk




--- Comment #7 from Bob MacCallum <r....@imperial.ac.uk>  2009-02-09 04:00:27 PST ---
I get this too on 2.2.8 compiled from source with

"./configure" \
"--prefix=/usr/local/apache_dir/httpd-2.2.8" \
"--enable-proxy" \
"--enable-proxy-ajp" \
"--enable-rewrite" \
"--enable-substitute" \

on Red Hat Linux 2.6.18-53.1.4.el5 x86_64

Note that the leak occurs even when the Substitute directive(s) have been
commented out, e.g.

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


-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


Dan Poirier <po...@pobox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #14 from Dan Poirier <po...@pobox.com>  2009-03-23 11:15:59 PST ---
Waiting for results of test patch.

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


Will Rowe <wr...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|                            |FIXED




--- Comment #20 from Will Rowe <wr...@apache.org>  2009-05-19 10:28:30 PST ---
Patch committed; so closing.

-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


John Moylan <jo...@nuatech.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john@nuatech.net




--- Comment #6 from John Moylan <jo...@nuatech.net>  2009-01-24 04:40:16 PST ---
I am experiencing similar issues with Apache 2.2.3 (Centos RPM and mod_substite
compiled from 2.2.11) and Apache 2.2.11 (compiled from source) on a x86_64
Centos 5.2 system. Using "niq" flags to append footers.

Prefork process sizes start at 2-3MB. Once requests start coming in the process
sizes start getting bigger and bigger until the system starts swapping. Running
without mod_substitute this problem does not happen. 

On a similar system using Apache 1.3.41 and mod_layout process size stays in
the 2-3MB region.

I can't put 2.2 into production because of this issue.


-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


rahul <ra...@sun.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
            Summary|mod_substitute has a memory |mod_substitute has a memory
                   |leak                        |leak (not a leak)




--- Comment #4 from rahul <ra...@sun.com>  2008-08-26 04:06:06 PST ---
(reducing priority since it is not a leak)


-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948





--- Comment #10 from Bob MacCallum <r....@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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak (not a leak)

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948





--- Comment #17 from Bob MacCallum <r....@imperial.ac.uk>  2009-03-24 03:15:08 PST ---
Thanks for the patch Dan.  With the patch applied, I am not seeing any leak on
a 378K index.html test file.

# wc -l logs/access_log ; ps auxwww | grep temp/bin/httpd 
296 logs/access_log
root       798  0.0  0.0  13896  1784 ?        Ss   10:07   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     799  0.3  0.0  14032  1888 ?        S    10:07   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     800  0.3  0.0  14032  1884 ?        S    10:07   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     801  0.3  0.0  14032  1892 ?        S    10:07   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     802  0.4  0.0  14032  1884 ?        S    10:07   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     803  0.4  0.0  14032  1884 ?        S    10:07   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     913  3.0  0.0  14028  1836 ?        S    10:08   0:00
/usr/local/apache_dir/temp/bin/httpd -k start

# wc -l logs/access_log ; ps auxwww | grep temp/bin/httpd 
10311 logs/access_log
root       798  0.0  0.0  13896  1784 ?        Ss   10:07   0:00
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     799  2.0  0.0  14032  1888 ?        S    10:07   0:06
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     800  1.9  0.0  14032  1884 ?        S    10:07   0:06
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     801  2.0  0.0  14032  1892 ?        S    10:07   0:06
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     802  2.0  0.0  14032  1884 ?        S    10:07   0:06
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     803  2.0  0.0  14032  1884 ?        S    10:07   0:06
/usr/local/apache_dir/temp/bin/httpd -k start
daemon     913  2.3  0.0  14028  1836 ?        S    10:08   0:05
/usr/local/apache_dir/temp/bin/httpd -k start


I don't really know the best way to test the (speed) performance of the patch,
and, anyway, there's another big job running on the machine right now so it's
not the best time.  But I will run some simple tests if you show me.

cheers,
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948





--- Comment #3 from Ruediger Pluem <rp...@apache.org>  2008-05-09 14:39:45 PST ---
Ok, this means that we do not have a leak here as the memory is reused by httpd
later on. httpd only does not pass back the memory it used once back to the OS
which is quite normal for all parts of httpd. It might still be worth to
examine the overall memory consumption of mod_substitute for the case you
described. OTOH your numbers show that the memory consumption does not grow
linear with the number of parallel requests but lower which is a good sign IMHO
:-)


-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


thomas wolfart <ka...@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |ASSIGNED




--- Comment #2 from thomas wolfart <ka...@gmx.net>  2008-05-09 08:15:11 PST ---
./ab -n 200 -c 1 http://localhost:8082/foo.html
1st run: 7 -> 14 MB
2nd run: stays at 14 MB
3rd run: stays at 14 MB


./ab -n 200 -c 25 http://localhost:8082/foo.html
1st run: 7 -> 71 MB
2nd run: 71 -> 74 MB
3rd run: stays at 74 MB 


./ab -n 200 -c 100 http://localhost:8082/foo.html
1st run: 7 -> 155 MB
2nd run: 155 -> 155 MB
3rd run: 155 -> 155 MB


Memory usage after the end of the ab call did not exceed 155 MB. Max memory
usage during test was about 390 MB.


-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


Takashi Sato <ta...@lans-tv.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |takashi@lans-tv.com




-- 
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


DO NOT REPLY [Bug 44948] mod_substitute has a memory leak

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44948


Ruediger Pluem <rp...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




--- Comment #1 from Ruediger Pluem <rp...@apache.org>  2008-05-07 08:09:50 PST ---
What does happen if you do

./ab -n 200 -c 1 http://localhost:8082/foo.html
./ab -n 200 -c 25 http://localhost:8082/foo.html
./ab -n 200 -c 100 http://localhost:8082/foo.html

again? Does the memory consumption still grow?


-- 
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