Memory usage problem (possibly fragmentation?)

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

 



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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090117/5ff7ed23/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