you can see the available pkg via sercmd, sending command pkg.stats (match the entry for the pid printing the error). If there is no free memory, then might be a leak.

You can attach with gdb to the pid printing these errors and walk to pkg, you see the commands for gdb at:


See if you have lot of allocated chunks from same place in source code (ignore those at the beginning, mainly related to cfg parsing) and send the details here.


On 12/21/11 10:44 AM, laura testi wrote:
we are using the PUA_XMPP and PUA modules from the master branch. When
the modules are started, everything are ok, the presence events from
XMPP are sent to kamailio SIP servers (PUBLISH/SUBSCRIBE) and cached
in the hash. But when there are several thousands records in the hash
tabel, the update_pua function called in the hashT_clean gives a lot
of "No memory left" error when the hashT_clean is waked up from the

ERROR: pua [send_subscribe.c]: No memory left
ERROR: pua [pua.c]: while building tm dlg_t structure

The failed call is:
	td = (dlg_t*)pkg_malloc(size);
	if(td == NULL)
		LM_ERR("No memory left\n");
		return NULL;

in dlg_t* pua_build_dlg_t(ua_pres_t* presentity) function in
send_subscribe.c. The size is about 400 and something... It's

Is it the memory leak in the PUA module?

I also try to increase the pkg_memory from 4MB default to 16MB, but it
doesn't help.

Any Idea?

Thanks in advanced


SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda