From owner-freebsd-current@freebsd.org Wed Sep 27 09:27:16 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9342BE2F6AC for ; Wed, 27 Sep 2017 09:27:16 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 083146AECD; Wed, 27 Sep 2017 09:27:15 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MA9Yv-1e3Q8Y3KOX-00BNVq; Wed, 27 Sep 2017 11:27:07 +0200 Date: Wed, 27 Sep 2017 11:27:06 +0200 From: "O. Hartmann" To: Guido Falsi Cc: "O. Hartmann" , freebsd-current Subject: Re: net/asterisk13: memory leak under 12-CURRENT? Message-ID: <20170927112706.436500ec@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: References: <20170926144522.21e59cfe@freyja.zeit4.iv.bundesimmobilien.de> <979b6cfe-0e38-5df3-7bb5-cdb8de6677bf@FreeBSD.org> <20170926154155.28deb2e1@freyja.zeit4.iv.bundesimmobilien.de> Organization: Walstatt MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:DYGCNeLtIoMEedAbXlWA8tCeUjsjUMvUj7OxhFZ+ZbmOvXOkvSd Kt81KNw7dXDuJqGhHvewlvgIasveyVbsa8jxHbQJoAknHbJeGLyZ7XquUw/kwD3nveYOJ5e NapFWtAMHxuJiaBgG9x496K2bneSjSLIvY6r4/hUCcR+1QcO0TTziTBN+xnmN0Sg8amMH0G NJYHkqDfVvZuE3SCUVPPA== X-UI-Out-Filterresults: notjunk:1;V01:K0:P2rbc7mo0yI=:VxFJBX46Nu6niqpEkFjjdb RiqG3qmf7mTHznp6Pr2JxO+bXzL2auR15lWfpjvvGF1br/A7WT+Qx9d+sXr4MHNyUPP4ARQDe JAaDBWUaFthnGabEEJhmQocLZtlrvEZoa6dUKIPgajVA+POGgXu427s/fgEOkH7r02R6fQ0wC 8IhFfrsUmbA38hllPx09sHO3lycIMysTMl6BGxYJtO014H518fyl/lDAGJz+iXQ5tA0QvbrrJ UZq7R0QOFvGUBhBCs3CZ4dGqlKzMpL6YCbJpplbDfJEeuTXfwrnODikHOCJodXAHRhl4CDYB3 RMd8jZb9LxoAeLrUbW1xe9C3BEB8jg160RGoZERiy3JLiZtH2l/lX/HhJfU0Q015QJD0vvfeT izolnYvrnOC1gP93TWU4vRROrK8AD66ZFsDBXCCVxCGi9Xh4V11M465zDzxmHj/5S/gC9IHew 1zEvqyfLt1jczmAehuOLat29cgqX49JgYhc8H6bravz/ImGuEhv0iJGB/HH2bBQymouYJJ1lO mI4PVjdHiIob4M8S58+HAJq2wMLfeAxS+A8KaBnjPaW3cNG7IqLTdZxFzH68dFP/AypYN/tO4 LTXT/uRv1P4NjQZAEW+LAiEfMdoySt8yb5jn00Ev6tCokLlDfE9WtMIF4mC3iC3c7y561f327 UWROLuQwYBnQQ0CKUtBv5BUdZ2Ipb0NvkgXr3gl9tRifaqjfrK35Z7pLDM74JOO4ECXAR3DFM bqmr4KA/hBAmYJeC/4wGzpTstYGiWERjkpp0suY+JIgpdifPCxW+U3gwOqrlmfMmjpRkDc1Il FEaGwuYi+DPaergqDkpBAVJteVaWWwD756XFnXC0TOkQ4sRuqQ= X-Mailman-Approved-At: Wed, 27 Sep 2017 10:57:18 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Sep 2017 09:27:16 -0000 On Wed, 27 Sep 2017 09:05:42 +0200 Guido Falsi wrote: > On 09/26/2017 15:41, O. Hartmann wrote: > > On Tue, 26 Sep 2017 15:06:23 +0200 > > Guido Falsi wrote: > > > Since I run net/asterisk with automatic module loading (I'm new to > > asterisk), this is very likely and might cause the problem somehow. > > > > You can exclude single modules from autoloading via modules.conf. I tried, but I need to study first more documentation to explore what is prerequisite and what is optional. > > >> Not sure, restarting the daemon should free any leaked memory the daemon > >> has. If a killed process leaves memory locked at the system level there > >> should be some other cause. > > > > Even with no runnidng asterisk, memory level drops after the last shutdown > > of asterisk and keeps that low. Even for weeks! My router never shows that > > high memory consumption, even under load. > > But while asterisk is running does the memory usage increase unbounded > till filling all available memory or does it stabilize at some point? As far as I could observe, a three day test run of the router/firewall/asterisk box drained around 500 MB of memory: starting at boot time with ~3700 MB, asterisk leaves the box with ~3640 MB after bein started and after three days the system reached ~3150 MB. Stopping asterisk gave back some memory, so ~3300 MB then was for days the final result - not recovering anything further. I use TEMPFS, if it matters, but I checked /tmp and /var/, there were no remnant files so far. TMPVAR is only allowed to have 256 MB. > > Asterisk is relatively memory hungry, especially with all modules > enabled. It also caches and logs various information in RAM, even doing > "nothing" it will cache and log that "nothing" activity. If memory does > stabilize after some point it's not really a leak but it's standard > memory usage. To reduce it you should disable all unused modules. > > > > > The question would be: how to use vmstat to give hints for those familiar > > with memory subsystems to indicate a real bug? > > > > I tried to find some advices, but maybe my English isn't good enough to make > > google help. > > I'm not able to give you a correct indication, but if the memory usage > is not increasing indefinitely but is stabilizing I'd say it's not > really a leak. > Can't say whether it is stabilising or not - I think the runtime is too short. I'll check first to disable some modules in the first place and then try to perform a test with several days of asterisk enabled.