Memory usage problem (possibly fragmentation?)

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

 



1, memory pool implementation of pjlib is good solution to avoid linux
memory fragmentation.

2, make sure your program code don't have memory leak. make sure your
program code will release dialog, tsx, tdata, rdata, timer after call
disconnected.
   use pjsip_endpt_dump() to dump after your load test or real world use

3, When I played with pjsip-perf program, the memory will be at a level and
wouln't higher and higner if concurrent calls and cps set to a static value.
I have run 1000 cps and 48 hours at that time. pjsip-perf is 0.9.0 release
version.

regards,
Gang

On Sun, Jan 18, 2009 at 5:37 AM, Mark Webster
<mark.webster+pjsip at gmail.com<mark.webster%2Bpjsip at gmail.com>
> wrote:

> Hello list!
>
> Well, I've been working on a nice simple, sturdy SBC & router, based on
> PJSIP. So far, it's quite stable, and I can hammer it with 100 calls/second
> for hours at a time and everything seems fine.
>
> However, under real world use, the process memory creeps higher and higher.
> I've managed to reproduce this by making and hanging up calls in random
> order. If I do it in a FIFO kinda orderly fashion, I don't see the problem.
> This leads me to believe that I'm running into a memory fragmentation issue.
> The problem is, even when the last call ends (and so in theory all "dynamic"
> pools have been released), the memory usage doesn't drop down. Again, if I
> make and hang up calls in an orderly fashion, I see the memory usage
> dropping back to normal after a few seconds.
>
> So, it does look like fragmentation, but I don't see why it wouldn't
> de-fragment after all resources are freed. If I leave my app running for a
> few days, it eventually crashes trying allocate memory for one of the SDP
> duplications upon receiving / making a new call. I see this behaviour in
> both the Linux and Win32 builds.
>
> I'm trying to come up with a solution. Ideally, I would like to avoid
> actually allocating any pools dynamically. The app allocates a static amount
> of everything else at start-up (so there's a hard limit on the number of
> concurrent calls, usually 500-1000), but things like dialog, tsx, and SDP
> creation / duplication seem to need new pools every time.
>
> What's the best solution? Write my own pjsip_endpt_create_pool() that
> dishes out pools from a static list? I know each pool might grow a few times
> at first but I expect everything to reach an equilibrium after taking a few
> thousand calls. Does this make sense?
>
> Thanks in advance
> -Mark Webster
>
> _______________________________________________
> 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/20090119/d24a72b1/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