Run Out of Shared Memory


Shared memory utilization in OpenSIPS increases linearly with SIP transactions. If OpenSIPS runs out of shared memory it will crash. The “child process exited by a signal 11” log message in OpenSIPS log file.

Log message:

Apr 2 21:14:02 dialer-osp2 /home/ospadmin/OSP/OSPreyPackage/opensips/sbin/opensips[18166]: Requesting OSP authorization and routing
Apr 2 21:14:02 dialer-osp2 /home/ospadmin/OSP/OSPreyPackage/opensips/sbin/opensips[18166]: INFO:osp:ospRequestRouting: request auth and routing for: service_type '0' source '[]:5060' source_dev '[]' source_networkid '' calling '9492565611' called '19852645453' preferred '' nprn '' npcic '' npdi '0' rpid '' pai '' div_user '' div_host '' pci '' call_id '' dest_count '12'
Apr 2 21:14:02 dialer-osp2 /home/ospadmin/OSP/OSPreyPackage/opensips/sbin/opensips[18015]: INFO:core:handle_sigs: child process 18139 exited by a signal 11
Apr 2 21:14:02 dialer-osp2 /home/ospadmin/OSP/OSPreyPackage/opensips/sbin/opensips[18015]: INFO:core:handle_sigs: core was not generated
Apr 2 21:14:02 dialer-osp2 /home/ospadmin/OSP/OSPreyPackage/opensips/sbin/opensips[18015]: INFO:core:handle_sigs: terminating due to SIGCHLD
Apr 2 21:14:02 dialer-osp2 /home/ospadmin/OSP/OSPreyPackage/opensips/sbin/opensips[18250]: Try the next route
Apr 2 21:14:02 dialer-osp2 /home/ospadmin/OSP/OSPreyPackage/opensips/sbin/opensips[18250]: INFO:core:sig_usr: signal 15 received


The “child process exited by a signal 11” message is an example of what OpenSIPS might log when it runs out of memory and crashes.


The solution is to edit the script so more shared memory is allocated to OpenSIPS. Here are the instructions:

  1. Navigate to the utils folder.
   [ospadmin@dialer-osp1 ~]$ cd $OpenSIPS_HOME/utils
   [ospadmin@dialer-osp1 utils]$ pwd
  1. Edit the last line of the script. In this example, 8,192 MB of RAM have been assigned to OpenSIPS.
   # This script checks if OpenSIPS is running. If the application is not running,
   # it executes from OpenSIPS_HOME/utils.
   if pgrep opensips >/dev/null 2>&1
   # Do nothing, the proxy is running
   exit 1
   echo "!!!OpenSIPS is not running!!!"
   echo "The application will be restarted"
   $OpenSIPS_HOME/sbin/opensips -m 8192
  1. Restart the OpenSIPS application. OpenSIPS will restart automatically within one minute if the opensips process is killed.
   [ospadmin@dialer-osp1 utils]$ pkill -9 opensips