Try to add a sleep call after push a couple tasks and see how that works.

Cheers,
Henry

2011/7/27 Cosmin Luță <cosmin.l...@avira.com>:
> Hi all,
>
> I have a rather strange use case for APR which leads to quick memory
> increase on Linux (at least): a program creates (in a loop) memory
> pools which are passed to tasks in a threadpool. Each task will call
> apr_pool_destroy on its pool (received as an argument).
>
> You can see the demo code here:
>
> http://pastebin.com/KWPKsLrc
>
> You can try to compile with:
>
> gcc -g -O0 -o test_pools  `apr-1-config --cflags --includes
> --cppflags`  -lapr-1 -laprutil-1 test_pools.c
>
> This is what I compile against (on an OpenSUSE 11.4 machine):
>
> % rpm -qa | grep libapr
> libapr-util1-debuginfo-1.3.9-9.2.x86_64
> libapr1-devel-1.4.2-3.1.x86_64
> libapr-util1-devel-1.3.9-9.2.x86_64
> libapr-util1-1.3.9-9.2.x86_64
> libapr1-1.4.2-3.1.x86_64
> libapr1-debuginfo-1.4.2-3.1.x86_64
>
>
> So, can anyone tell me what I'm missing here? I'm aware that it's not
> very usual to create a pool in a thread, then pass it as a pointer to
> another, but I don't think that's the source of the memory increase.
> Any ideas what I can do to stop this from happening?
>
>
> Best regards,
>
>
> --
> --
> Cosmin Luță
> Software Developer
> AVIRA Soft srl
>
>
>

Reply via email to