<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi.</p>
<p><br>
</p>
<p>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.</p>
<p>Everything is ok.</p>
<p>See how I start the OpenSIPS in my computer:<br>
</p>
<p><i><font color="#006fc9">/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</font></i></p>
<p><br>
</p>
<p><i><font color="#006fc9">So, 64 Mbyte of shared memory and 4 Mbyte of private memory.<br>
</font></i></p>
<p><br>
</p>
<p><br>
</p>
<p>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.</p>
<p><br>
</p>
<p><br>
</p>
<p><font color="#FF0000">Dec 1 19:12:02 [232] ERROR:db_sqlite:db_sqlite_connect: Can't open database: out of memory<br>
Dec 1 19:12:02 [232] ERROR:db_sqlite:db_sqlite_new_connection: initial connect failed<br>
<br>
</font></p>
<p><br>
</p>
<p>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.</p>
<p>So, I have tried to solve the problem (<u>giving more memory to the SQLite</u>) doing the following steps:</p>
<p><br>
</p>
<p>1 - starting opensips with 32MB share memory: STARTOPTIONS="-m 32"</p>
<p><br>
</p>
<p>2 - Configuring the size of the hash table internally used to keep the dialogs. EX: modparam("dialog", "hash_size", 1024) . Default is 4096.<br>
</p>
<p><br>
</p>
<p>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.</p>
<p><br>
</p>
<p>How to solve such problem?</p>
<p><br>
</p>
<p>How could be a good use of -M and -m options to give more memory to OpenSIPs or to SQLite?</p>
<p><br>
</p>
<p>Should I increase or decrease the value of '-m' flag?<br>
</p>
<p><br>
</p>
<p>Any hint will be very helpful!</p>
<p>Thanks a lot!</p>
<p><br>
</p>
<p>Best regards!</p>
<p><br>
</p>
<p>-------------------------------------------------------------------------------</p>
<p><br>
</p>
<p>P.S.: as curiosity, bellow is the file Makefile.config.<br>
</p>
<p><br>
</p>
<div style="color: rgb(0, 0, 0);">
<div>
<div style=""><span lang="EN-US"> </span>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">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</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US"> </span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">include_modules?= dialplan db_sqlite presence</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US"> </span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">DEFS+= -DPKG_MALLOC #Uses a faster malloc (exclusive w/ USE_SHM_MEM)</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">DEFS+= -DSHM_MMAP #Use mmap instead of SYSV shared memory</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">DEFS+= -DUSE_MCAST #Compile in support for IP Multicast</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">DEFS+= -DDISABLE_NAGLE #Disabled the TCP NAgle Algorithm ( lower delay )</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DSTATISTICS #Enables the statistics manager</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">DEFS+= -DHAVE_RESOLV_RES #Support for changing some of the resolver parameters</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DHP_MALLOC #High performance allocator with fine-grained locking</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">DEFS+= -DF_MALLOC #An even faster allocator. Not recommended for debugging</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DF_MALLOC_OPTIMIZATIONS #Remove all internal checks in F_MALLOC</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DDBG_QM_MALLOC #Allocator used for debugging information</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DUSE_SHM_MEM #All PKG allocations are mapped to SHM ( exclusive w/ PKG_MALLOC )</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DDBG_F_MALLOC #TODO ? </span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DNO_DEBUG #Turns off all debug messages</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DNO_LOG #Completely turns off all the logging</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DVQ_MALLOC #TODO ?</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DFAST_LOCK #Uses fast architecture specific locking</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DUSE_FUTEX #Uses linux futexs with fast architecture specific locking</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DUSE_SYSV_SEM #Uses SYSV sems for locking ( slower & limited number of locks</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">DEFS+= -DUSE_PTHREAD_MUTEX #Uses pthread mutexes</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DBUSY_WAIT #Uses busy waiting on the lock</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DDBG_LOCK #TODO ?</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">DEFS+= -DNOSMP #Do not use SMP sompliant locking. Faster but won't work on SMP machines
</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DEXTRA_DEBUG #Compiles in some extra debugging code</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US">#DEFS+= -DORACLE_USRLOC #Uses Oracle compatible queries for USRLOC</span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US"> </span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US"> </span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US"></span></p>
<p><br>
</p>
<font size="2">
<div class="PlainText">RODRIGO PIMENTA CARVALHO<br>
Inatel Competence Center<br>
Software<br>
Ph: +55 35 3471 9200 RAMAL 979</div>
</font>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span style="color:#1F497D"></span></p>
<p style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: "Calibri","sans-serif";">
<span lang="EN-US"> </span></p>
</div>
</div>
</div>
</div>
</body>
</html>