<p>Your patch will override memory size set by "-m" option in case it is 64mb (-m 64).<br>
I created another patch for my environment by moving setting sm_mem_size to default size after yyparse().</p>
<p>--- kamailio-4.4.3.orig/main.c  2016-09-14 16:50:30.000000000 +0300<br>
+++ kamailio-4.4.3/main.c       2017-01-26 18:30:55.000000000 +0300<br>
@@ -2069,9 +2069,6 @@<br>
abort();<br>
}<br>
}</p>
<ul>
<li>
<pre><code>  if (shm_mem_size == 0) {
</code></pre>
</li>
<li>
<pre><code>          shm_mem_size = SHM_MEM_POOL_SIZE;
</code></pre>
</li>
<li>
<pre><code>  }

  if (endianness_sanity_check() != 0){
          fprintf(stderr, "BUG: endianness sanity tests failed\n");
</code></pre>
</li>
</ul>
<p>@@ -2136,6 +2133,11 @@</p>
<pre><code>            goto error;
    }
</code></pre>
<ul>
<li></li>
<li>
<pre><code>  if (shm_mem_size == 0) {
</code></pre>
</li>
<li>
<pre><code>          shm_mem_size = SHM_MEM_POOL_SIZE;
</code></pre>
</li>
<li>
<pre><code>  }
</code></pre>
</li>
<li>
<pre><code>  if (cfg_warnings){
          fprintf(stderr, "%d config warnings\n", cfg_warnings);
  }
</code></pre>
</li>
</ul>
<p>It also would be good to add documentation for shm_mem_size parameter in config file (I did not find it).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/950#issuecomment-276317456">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZX0GikNaSUW1PfNJ5QCYlEFMeCbMks5rXwFWgaJpZM4LuwD0">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZRtvSJorMbZUCcqcnDA3L5bI-0_Oks5rXwFWgaJpZM4LuwD0.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/950#issuecomment-276317456"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@mmalygin in #950: Your patch will override memory size set by \"-m\" option in case it is 64mb (-m 64).\r\nI created another patch for my environment by moving setting sm_mem_size to default size after yyparse().\r\n\r\n--- kamailio-4.4.3.orig/main.c  2016-09-14 16:50:30.000000000 +0300\r\n+++ kamailio-4.4.3/main.c       2017-01-26 18:30:55.000000000 +0300\r\n@@ -2069,9 +2069,6 @@\r\n                                        abort();\r\n                }\r\n        }\r\n-       if (shm_mem_size == 0) {\r\n-               shm_mem_size = SHM_MEM_POOL_SIZE;\r\n-       }\r\n\r\n        if (endianness_sanity_check() != 0){\r\n                fprintf(stderr, \"BUG: endianness sanity tests failed\\n\");\r\n@@ -2136,6 +2133,11 @@\r\n\r\n                goto error;\r\n        }\r\n+\r\n+       if (shm_mem_size == 0) {\r\n+               shm_mem_size = SHM_MEM_POOL_SIZE;\r\n+       }\r\n+\r\n        if (cfg_warnings){\r\n                fprintf(stderr, \"%d config warnings\\n\", cfg_warnings);\r\n        }\r\n\r\nIt also would be good to add documentation for shm_mem_size parameter in config file (I did not find it)."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/950#issuecomment-276317456"}}}</script>