apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yoshiki Hayashi <yosh...@xemacs.org>
Subject APR pool maintains too much free list
Date Mon, 28 Jan 2002 14:11:30 GMT
I noticed this while looking at Subversion issue #602.  It
is about Subversion consuming too much memory when importing
large tree.

I found that memory consumption doesn't go too high if I
compiled APR with --enable-pool-debug so I glanced
memory/unix/apr_pools.c.  There I found that non-DEBUG build
does not free any memory unless the pool holding the
allocator is destroyed or cleared.  I think it should free
memory if it already has enough memory in free list.

Here's a sample code to test that behavior.  It is not as
portable as APR itself (it uses fprintf and printf) and
almost no error check is done, but it should compile on most
UNIX platforms.  It recursively stat directories and read
the contents of files into memory.  It creates subpool for
each recursive entry to new directories and destroys it upon
exit.  Run it like ./test ~/ and see how the process
continues to grow despite subpool destruction.

View raw message