httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <b...@wstoddard.com>
Subject Re: memory leak
Date Tue, 06 Feb 2001 22:25:53 GMT
The bucket code is too damn complicated.

I -think- the problem is in apr_bucket_make_shared.  Here is the scenario...

apr_bucket_make_file() mallocs an apr_bucket_file and places the apr_file_t
pointer in it then calls apr_bucket_make_shared()

apr_bucket_make_shared() mallocs an apr_bucket_shared struct, hangs the
apr_bucket_file off the apr_bucket_shared than hangs a pointer to the
apr_bucket_shared struct off the buckets data pointer. Uuugh...

The problem occurs when Apache does a file_read() on the bucket. file_read
(apr_buckets_file.c) mmaps the file, then calls apr_bucket_make_shared() which
repeats the steps above, except hanging an apr_mmap_t off the
apr_bucket_shared rather than an apr_file_t. The problem is the second
apr_bucket_shared (mmap) replaces the first one (file), effectively stranding
the first apr_bucket_shared struct that contains the apr_file_t.

So, should apr_bucket_make_shared be modified to handle linked lists of shared
structures?

> A single request to FAQ.html (server parsed content) results in 214 calls to
> malloc/calloc and 208 calls to free!
>
> My question... Do I spend time tracking this down or are we ready to start
> using pools for buckets?
>
> Bill
>


Mime
View raw message