|
Resources -> Documentation -> Out Of MemoryWhat to do if "out of memory" or "no more memory" messages are generated by OpenSIPS? Potential causesThere are two cause that may lead to memory starvation: a) a small pool of memory - the configured memory is not enough and no more memory can be allocated. b) memory leak - some memory id not properly freed, making all the memory unavailable (not used, but still allocated) Determining the causeIf the memory starvation is because of a too small pool of memory, by stopping the traffic on the proxy (without stopping the proxy), the allocated memory will be freed in time (as transactions and location records are freed). TEST: wait ~ 20 minutes without any kind of load the proxy. Test the proxy by placing several calls; if the memory errors pop up again once the traffic is resumed, it means it's a memory leak somewhere; If not sure of the result, consider it's a memory leak. How to handle itIf the memory pool is too small, just go in config.h and increase the size of the memory pool - for SHM or PKG. If it is about a memory leak, you need to compile the debug support into memory manager. To do so, follow the next steps: 1. edit Makefile.defs file and remove from the DEFS string the F_MALLOC define (delete "-DF_MALLOC" line) and add the DBG_QM_MALLOC define (insert a "-DDBG_QM_MALLOC" line). 2. recompile everything 3. set memlog=1 in your configuration script (to get the memory messages) - it must be lower than debug. 4. restart your proxy Now, you may check the memory status in two situations: 1. **At shutdown** - just stop the proxy - the memory manager will dump the memory status. Normally most of the memory is cleaned during shutdown. If there is memory leak, it should be visible as not-freed memory. A memory status looks like: 0(17665) Memory status (shm):
0(17665) qm_status (0xb5a7e000):
0(17665) heap size= 33554432
0(17665) used= 1592952, used+overhead=1811564, free=31742868
0(17665) max used (+overhead)= 1811564
0(17665) dumping all alloc'ed. fragments:
0(17665) 0. N address=0xb5ab240c frag=0xb5ab23f4 size=4 used=1
0(17665) alloc'd from mem/shm_mem.c: shm_mem_init_mallocs(199)
0(17665) start check=f0f0f0f0, end check= c0c0c0c0, abcdefed
0(17665) 1. N address=0xb5ab2440 frag=0xb5ab2428 size=4 used=1
0(17665) alloc'd from timer.c: init_timer(52)
0(17665) start check=f0f0f0f0, end check= c0c0c0c0, abcdefed
2. **At run time** - you may check the memory status by sending SIGUSR1 signal to the process (do "kill -SIGUSR1 OPENSIPS_PID") - it will dump the SHM and PKG (only for that process) memory status. It is highly recommended to do this after waiting about 20 minutes to be sure that as much as possile memory is freed - all temporary memory used during processing is freed by lack of load on the proxy. Go through the log and see if there is something suspicious, like too much memory still allocated from same place, etc... If you have no clue how to interpret the logs for memory status, post it on a FTP or HTTP server and send the link on the devel@lists.opensips.org mailing list. | News OpenSIPS Getting Started21st of April 2012
OpenSIPS Getting Started Video Tutorial about how to do an installation of OpenSIPS and OpenSIPS-CP... OpenSIPS Devel Course12th of April 2012
Learn about OpenSIPS internals both core and modules... OpenSIPS 1.8.022nd of March 2012
OpenSIPS 1.8.0 major release ready... Dynamic Routing20th of March 2012
Enhancements of DR engine... APT repository23nd of February 2012
New official APT repository for Debian & Ubuntu OpenSIPS 1.7.222nd of February 2012
OpenSIPS 1.7.2 minor release out... SIP Validation Support20th of February 2012
Prevent malformed SIP messages from propagating through your network DNS Caching Support13th of February 2012
Cache system for all types of DNS records Distributed Dialog Profiles9th of February 2012
Shared dialog profiles between multiple instances of OpenSIPS Configuration and Scripting Tool19th of January 2012
Graphical Configuration and Scripting Tool for OpenSIPS Cassandra driver05th of January 2012
Cassandra backend for OpenSIPS LUA integration05th of January 2012
Using LUA scripting with OpenSIPS OpenSIPS Pavilion @ ITExpo 201222th of December 2011
OpenSIPS Pavilion booth #535, 1-3 Feb 2012 OpenSIPS and HOMER14th of December 2011
Distributed SIPtracing and SIPcapturing OpenSIPS eBootcamp12th of December 2011
New Ebootcamp session starting on 15th of February 2012. OpenSIPS 1.7.123rd of November 2011
OpenSIPS 1.7.1 minor release out... Ratelimit3rd of November 2011
Dynamic and distributed support... OpenSIPS VM 1.7.01st of November 2011
Live Virtual Machine for OpenSIPS 1.7... MI via HTTP25th of October 2011
Bultin HTTP server for MI... Events via RabbitMQ12th of October 2011
Event Interface can push events via RabbitMQ... Key-Value Cache/DBs6th of October 2011
Script and module support for key-value oriented backend... GRUU support4th of October 2011
OpenSIPS registrar with GRUU / RFC5627... OpenSIPS 1.8.0 preview30th of September 2011
What is set to be done for OpenSIPS 1.8.0... OpenSIPS eBootcamp28th of July 2011
New Ebootcamp session starting on 19th of September. OpenSIPS 1.7.012nd of July 2011
OpenSIPS 1.7.0 major release ready... ClueCon 201111th of July 2011
Talks and one-day free training New in 1.7.06th of July 2011
What is new in OpenSIPS 1.7.0 SVN Freeze30th of June 2011
Testing phase started for 1.7 release Topology Hiding30th of June 2011
Topology Hiding based on dialog module New AVP naming23rd of June 2011
A simpler and more efficient way of naming AVPs DB Optimization22nd of June 2011
Multi-row DB insert operations. Event Notification Interface26th of May 2011
External interaction via the Event Interface. OpenSIPS eBootcamp28th of March 2011
New Ebootcamp session starting on 2nd of May. UAC_REGISTRANT module10th of March 2011
New module to allow OpenSIPS to UAC register. Performance degradation with complexity08th of March 2011
Tests to show how performance is affected with complexity. Load and performance monitoring22nd of February 2011
New statistics and traps for OpenSIPS monitoring. OpenSIPS 2.017th of February 2011
OpenSIPS 2.0 first code release. OpenSIPS Online Meeting15th of February 2011
OpenSIPS Online Monthly Meetings started. OpenSIPS Social Event24th of January 2011
OpenSIPS Social Event - Miami, 3rd of February. OpenSIPS eBootcamp17th of January 2011
New Ebootcamp session starting on 28th of February. OpenSIPS 1.6.420th of December 2010
OpenSIPS 1.6.4 major release ready... OpenSIPS media timeout16th of December 2010
Ghost call hunting with media timeout ... |