httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Stoddard <b...@wstoddard.com>
Subject Re: Q?, BUG:[mod_mem_cache] size & object count
Date Tue, 28 Oct 2003 20:01:17 GMT
Jean-Jacques Clar wrote:

> Looking at two pairs of fields used to keep the current cache size and 
> object count:
> from struct: 
> mem_cache_conf (mod_mem_cache.c):
> apr_size_t cache_size
> apr_size_t object_cnt
>  
> cache_cache_t (cache_cache.c):
> apr_size_t current_size
>  
> cache_pqueue_t (cache_pqueue.c):
> apr_size_t size (-1, element 0 does not count)
>  
> The two pair of fields ((cache_size - current_size) & (object_cnt - 
> size)) must be keep in sync in every case.
> Is that a true statement?
>  
> There is at least one case, where it is not happening:
> cache_cache.c, cache_insert() ->ejecting one of the entity.
> c->current_size and the queue size are adjusted inside the while loop, but
> the cache_size and object_cnt fields are never adjusted down in 
> mod_mem_cache.c.
>  
> cache_size and object_cnt are not used inside any logic.
> My questions are:
> Should they be keep in sync (probably using memcache_cache_free())?
>  
> Should they just be removed if they don't have any usage?
>  

If they are no longer being used, remove them. I expect we were using 
them at one time, then Ian (?) added the nifty cache_pqueue stuff which 
made the fields superfluous.

Bill


Mime
View raw message