<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13597">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pbx.c: Include filesystem cache in free memory calculation<br><br>ASTERISK-28695 #close<br>Reported by: Kevin Flyn<br><br>Change-Id: Ief098bb6eb77378daeace8f97ba30701c8de55b8<br>---<br>A doc/CHANGES-staging/minmemfree.txt<br>M main/pbx.c<br>2 files changed, 8 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/97/13597/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/doc/CHANGES-staging/minmemfree.txt b/doc/CHANGES-staging/minmemfree.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..5762c15</span><br><span>--- /dev/null</span><br><span>+++ b/doc/CHANGES-staging/minmemfree.txt</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: minmemfree</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The 'minmemfree' configuration option now counts memory allocated to</span><br><span style="color: hsl(120, 100%, 40%);">+the filesystem cache as "free" because it is memory that is available</span><br><span style="color: hsl(120, 100%, 40%);">+to the process.</span><br><span>diff --git a/main/pbx.c b/main/pbx.c</span><br><span>index 6584735..3d73a7b 100644</span><br><span>--- a/main/pbx.c</span><br><span>+++ b/main/pbx.c</span><br><span>@@ -4571,7 +4571,7 @@</span><br><span>     int failed = 0;</span><br><span>      double curloadavg;</span><br><span> #if defined(HAVE_SYSINFO)</span><br><span style="color: hsl(0, 100%, 40%);">- long curfreemem;</span><br><span style="color: hsl(120, 100%, 40%);">+      unsigned long curfreemem;</span><br><span>    struct sysinfo sys_info;</span><br><span> #endif</span><br><span> </span><br><span>@@ -4593,8 +4593,8 @@</span><br><span>       if (option_minmemfree) {</span><br><span>             if (!sysinfo(&sys_info)) {</span><br><span>                       /* make sure that the free system memory is above the configured low watermark</span><br><span style="color: hsl(0, 100%, 40%);">-                   * convert the amount of freeram from mem_units to MB */</span><br><span style="color: hsl(0, 100%, 40%);">-                        curfreemem = sys_info.freeram * sys_info.mem_unit;</span><br><span style="color: hsl(120, 100%, 40%);">+                     * convert the amount of available RAM from mem_units to MB */</span><br><span style="color: hsl(120, 100%, 40%);">+                        curfreemem = (sys_info.freeram + sys_info.bufferram) * sys_info.mem_unit;</span><br><span>                    curfreemem /= 1024 * 1024;</span><br><span>                   if (curfreemem < option_minmemfree) {</span><br><span>                             ast_log(LOG_WARNING, "Available system memory (~%ldMB) is below the configured low watermark (%ldMB)\n", curfreemem, option_minmemfree);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13597">change 13597</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/13597"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Ief098bb6eb77378daeace8f97ba30701c8de55b8 </div>
<div style="display:none"> Gerrit-Change-Number: 13597 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>