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 memory growth
Date Wed, 25 Feb 2004 09:31:32 GMT
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