pjsip-perf memory size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 9, 2008 at 11:40 AM, Gang Liu <gangban.lau at gmail.com> wrote:

> Hi, benny
>
>      I wrote a small program which use pjlib memory pool or malloc/free to
> continue alloc many small memory blocks and reture back to os.
>
>      The testing results are the same as pjsip-perf. So I think the reason
> is It might be fragmented the memory with too many small allocations.
>
>
Actually that's one of the reason to use the pool, to avoid allocating small
chunks. If memory fragmentation is the problem, then it'll be much worse if
the pool is not used.


>      BTW, How can I set policy to let caching pool factory to using a
> static/contiguous/preallocated memory?
>
> "A pool factory can be given different policy during creation to make it
> behave differently. For example, caching pool factory can be configured to
> allocate and deallocate from a static/contiguous/preallocated memory instead
> of using malloc()/free()."
>
>
Borrowing C++ terms, pool factory is an abstract base class, and the caching
pool is one of the implementation class, derived from it. To create a pool
factory that doesn't allocate dynamic memory, you'd need to "derive" a
"class" from pool factory, and use this as the pool factory for the
application (instead of the caching pool).

Cheers
 Benny



> regards,
> Gang
>
>
>
> On Fri, Oct 3, 2008 at 11:28 AM, Gang Liu <gangban.lau at gmail.com> wrote:
>
>> Thanks. I will try again.
>>
>> regards,
>> Gang
>>
>> On Fri, Oct 3, 2008 at 6:18 AM, Benny Prijono <bennylp at pjsip.org> wrote:
>>
>>> On Thu, Oct 2, 2008 at 12:06 PM, Gang Liu <gangban.lau at gmail.com> wrote:
>>>
>>>> hi benny,
>>>>     When I view source code of pj memory pool, I found there is a
>>>> PJ_HAS_POOL_ALT_API for pool debug purpose.
>>>>     But compile fail if I define PJ_HAS_POOL_ALT_API and PJ_POOL_DEBUG
>>>> in config_site.h.
>>>>
>>>>
>>> I've got to admit that I've never used PJ_HAS_POOL_ALT_API on
>>> non-Windows, so no surprise there. Having said that, I've just fixed this in
>>> http://trac.pjsip.org/repos/ticket/655.
>>>
>>> Thanks
>>>  Benny
>>>
>>>
>>>
>>>> regards,
>>>> Gang
>>>>
>>>>
>>>>
>>> _______________________________________________
>>> Visit our blog: http://blog.pjsip.org
>>>
>>> pjsip mailing list
>>> pjsip at lists.pjsip.org
>>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>>
>>>
>>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20081009/251a2f60/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux