[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: apr pools & memory leaks

From: Mladen Turk <mturk_at_apache.org>
Date: Thu, 02 Oct 2008 09:44:33 +0200

Ben Collins-Sussman wrote:
> Our solution:
> Over at Google, we simply hacked APR to *never* hold on to blocks for
> recycling. Essentially, this makes apr_pool_destroy() always free()
> the block, and makes apr_pool_create() always call malloc() malloc.
> Poof, all the memory leak went away instantly.
>

Why not creating allocator for each of those subpools.
On pool_destroy it'll destroy allocator and call free()
consuming the global pool only for allocating subpools
which are constant in size, thus no fragmentation can
occur.

Regards

-- 
^(TM)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-10-03 00:42:11 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.