Sorry for late response, but I think this might interest other people, too..
2008/12/4 Friedrich Möller <friedrich.moel...@beronet.com>: > I still have massive memory problems running a sofia application on ARM. > > I've made a couple of tests, maybe anyone has a clue what might causing > this: > > If I send 1000 invites to a simple nua client (handles are created by > sofia), which I immediately cancel and destroy in the callback function, > I have following effect: > > 1000 invites, 10 ms between each invite, memory usage goes up to 14,7% > and stays there. > 1000 invites, 100 ms between each invite, memory usage goes up to 4,3% > and stays there. > 1000 invites, 1000 ms between each invite, memory usage goes up to 2,8% > and stays there. The INVITE transaction is sent, and I'm afraid nta keeps track of them and nua tries to CANCEL them even after you have called nua_handle_destroy(). If the INVITE is never responded, the effect is worst (as stack keeps INVITE in memory for 40 seconds and retransmits it for the sole purpose of being able to eventually send the CANCEL request). Do you have some kind of server responding to your INVITEs? Making large number of calls at very short time also fragments your memory heap, so that small chunks of memory are used from here and there. Even if the memory is free()d, most of the pages are still in use. A more intelligent allocator would probably help, like keeping memory allocations for a particular su_home_t on a single page, and not not letting multiple homes to allocate memory from the same page (it was that way originally, but my implementation lead to even worse fragmentation ;-). > Creating the handles myself: > If I just create 1000 nua_handles in one loop, and after that run a loop > destroying the 1000 handles memory peaks at 3,9%, and then drops to 3,2 %. > If I run a loop of 1000 iterations, in each creating a handle and > immediately call nua_handle_destroy on it, the memory usage goes up to > 2,7% and stays there. > > For each test I let the program run for ~5 minutes after the last handle > was created, to see if there is some change in memory usage, but there > wasn't. > The memory usage of the client before any handles are created is 2,3 %, > I've 64 MB system memory in total on my machine. Making large number of calls in a very small memory footprint is challenging... -- Pekka.Pessi mail at nokia.com ------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel