]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix calculation of free RAM to make minmemfree option work.
authorRussell Bryant <russell@russellbryant.com>
Fri, 6 May 2011 21:06:33 +0000 (21:06 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 6 May 2011 21:06:33 +0000 (21:06 +0000)
(closes issue #17124)
Reported by: loic
Patches:
      pbx_c.diff uploaded by loic (license 1020)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@317917 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index 1d4ea026fce9d530bd2083d88c07ad3f491a9af6..63cbd22b19a27a081a6750eba35773ab104f1bff 100644 (file)
@@ -5002,7 +5002,7 @@ static int increase_call_count(const struct ast_channel *c)
                if (!sysinfo(&sys_info)) {
                        /* make sure that the free system memory is above the configured low watermark
                         * convert the amount of freeram from mem_units to MB */
-                       curfreemem = sys_info.freeram / sys_info.mem_unit;
+                       curfreemem = sys_info.freeram * sys_info.mem_unit;
                        curfreemem /= 1024 * 1024;
                        if (curfreemem < option_minmemfree) {
                                ast_log(LOG_WARNING, "Available system memory (~%ldMB) is below the configured low watermark (%ldMB)\n", curfreemem, option_minmemfree);