apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Athavale <amit_athav...@persistent.co.in>
Subject Re: memory growth
Date Wed, 25 Feb 2004 12:19:29 GMT
Sorry for bad formatting, basically arrow should be in between 
apr_pool_clear() and
"put back new data on pool".

Amit Athavale wrote:

> Hi,
>
> I came across following strange(?) behavior while fixing a problem.
>
> ----------------
> apr_pool_t *pool;
>
> thread 1--->put data on pool--->---->apr_pool_clear(pool)--->put back 
> new data on pool
>                                                                        
>                     ^
>                                                                        
>                      |
> thread 2 ---> accesses data at this point -------------------------
> ----------------
>
> Clearly this is a bug in my code (it tries to access data on cleared 
> pool), but the
> strange behavior is, I see increase in memory usage of a process (used 
> "pmem <pid> | grep heap")
>
> Anyway I have fixed it by putting locks around (and that stops memory 
> growth !)
>
> But it will be better if somebody explains why memory increase in such 
> case ?
> Sorry if I am asking obvious question.
>
>
> TIA
> Amit.
>
>



Mime
View raw message