[OpenSIPS-Users] How to avoid 'out of memory' issue ? I'm a bit confused if '-m' and '-M' options...

Rodrigo Pimenta Carvalho pimenta at inatel.br
Tue Dec 1 21:05:34 CET 2015


Hi.


I have used OpenSIPS without problems in my computer. It is OpenSIPS 2.2. I'm also using SQLite 3.0 as the OpenSIPS database.

Everything is ok.

See how I start the OpenSIPS in my computer:

/usr/local/opensips_proxy/sbin/opensips -P /var/run/opensips/opensips.pid -m 64 -M 4 -u root -g root -E -f /usr/local/opensips_proxy/etc/opensips/opensips_residential_2015-11-5_16_46_31.cfg


So, 64 Mbyte of shared memory and 4 Mbyte of private memory.



However, after porting OpenSIPS 2.2 and SQLite 3.0 in another system (embedded system) and still using the same configurations files, I got an 'out of memory' issue.



Dec  1 19:12:02 [232] ERROR:db_sqlite:db_sqlite_connect: Can't open database: out of memory
Dec  1 19:12:02 [232] ERROR:db_sqlite:db_sqlite_new_connection: initial connect failed



My current platform has 109 Mbyte of free memory before starting OpenSIPS. When I try to start it, I got 'out of memory' to open SQLite.

So, I have tried to solve the problem (giving more memory to the SQLite) doing the following steps:


1 - starting opensips with 32MB share memory: STARTOPTIONS="-m 32"


2 - Configuring the size of the hash table internally used to keep the dialogs. EX: modparam("dialog", "hash_size", 1024) . Default is 4096.


It seems that the option "-m 32" didn't take effect?  I suspect that in the embedded system OpenSIPs is trying to use much more that 32 or 64 Mbyte. So SQLite doesn't have sufficient memory.


How to solve such problem?


How could be a good use of -M and -m options to give more memory to OpenSIPs or to SQLite?


Should I increase or decrease the value of '-m' flag?


Any hint will be very helpful!

Thanks a lot!


Best regards!


-------------------------------------------------------------------------------


P.S.: as curiosity, bellow is the file Makefile.config.




exclude_modules?= aaa_radius b2b_logic cachedb_cassandra cachedb_couchbase cachedb_memcached cachedb_mongodb cachedb_redis carrierroute compression cpl-c db_berkeley db_http db_mysql db_oracle db_perlvdb db_postgres db_unixodbc emergency event_rabbitmq h350 regex identity jabber json ldap lua httpd mi_xmlrpc_ng mmgeoip osp perl pi_http presence presence_dialoginfo presence_mwi presence_xml proto_sctp proto_tls pua pua_bla pua_dialoginfo pua_mi pua_usrloc pua_xmpp python rest_client rls sngtc snmpstats tlsops xcap xcap_client xmpp



include_modules?= dialplan db_sqlite presence



DEFS+= -DPKG_MALLOC #Uses a faster malloc (exclusive w/ USE_SHM_MEM)

DEFS+= -DSHM_MMAP #Use mmap instead of SYSV shared memory

DEFS+= -DUSE_MCAST #Compile in support for IP Multicast

DEFS+= -DDISABLE_NAGLE #Disabled the TCP NAgle Algorithm ( lower delay )

#DEFS+= -DSTATISTICS #Enables the statistics manager

DEFS+= -DHAVE_RESOLV_RES #Support for changing some of the resolver parameters

#DEFS+= -DHP_MALLOC #High performance allocator with fine-grained locking

DEFS+= -DF_MALLOC #An even faster allocator. Not recommended for debugging

#DEFS+= -DF_MALLOC_OPTIMIZATIONS #Remove all internal checks in F_MALLOC

#DEFS+= -DDBG_QM_MALLOC #Allocator used for debugging information

#DEFS+= -DUSE_SHM_MEM #All PKG allocations are mapped to SHM ( exclusive w/ PKG_MALLOC )

#DEFS+= -DDBG_F_MALLOC #TODO ?

#DEFS+= -DNO_DEBUG #Turns off all debug messages

#DEFS+= -DNO_LOG #Completely turns off all the logging

#DEFS+= -DVQ_MALLOC #TODO ?

#DEFS+= -DFAST_LOCK #Uses fast architecture specific locking

#DEFS+= -DUSE_FUTEX #Uses linux futexs with fast architecture specific locking

#DEFS+= -DUSE_SYSV_SEM #Uses SYSV sems for locking ( slower & limited number of locks

DEFS+= -DUSE_PTHREAD_MUTEX #Uses pthread mutexes

#DEFS+= -DBUSY_WAIT #Uses busy waiting on the lock

#DEFS+= -DDBG_LOCK #TODO ?

DEFS+= -DNOSMP #Do not use SMP sompliant locking. Faster but won't work on SMP machines

#DEFS+= -DEXTRA_DEBUG #Compiles in some extra debugging code

#DEFS+= -DORACLE_USRLOC #Uses Oracle compatible queries for USRLOC






RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20151201/d5f4976b/attachment-0001.htm>


More information about the Users mailing list