From owner-freebsd-current@freebsd.org Thu Sep 28 06:11:57 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 2A815E29E60 for ; Thu, 28 Sep 2017 06:11:57 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (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 8D630716D8; Thu, 28 Sep 2017 06:11:55 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LkCU2-1dMTKt3YXS-00cB2f; Thu, 28 Sep 2017 08:11:54 +0200 Date: Thu, 28 Sep 2017 08:11:52 +0200 From: "O. Hartmann" To: Guido Falsi Cc: "O. Hartmann" , freebsd-current Subject: Re: net/asterisk13: memory leak under 12-CURRENT? Message-ID: <20170928081152.1b2f039c@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:8nzT1+AdMsb7NZki2q7nOqdXW2LvjdYEVAt25yoEsoDBqkZNiHN 91i36wBYdZxYeFWduGFSSlHqEx34PgRRKrOeLY56Z2ynuIbtr8dP70EiCeaK5IcG2iSGBgO Yu8gynfsboCkIuurHfyBMaKK+gcWfmmOXJmnRiOiUBR+rbNQGD+vS4ZLs6RJnfJbADF+0VK 9wQnZhl+06g5EmBaZE9uw== X-UI-Out-Filterresults: notjunk:1;V01:K0:vW5w82ndmAo=:o1nGaX03Yd6MX+yo42j23t 2SmUei1yyYE1wh1PCJw4RLBBlJiON6KkZA4L3/p15GKoC94dl0bpwFSaX62+2i9NfERMYqgHV m6Ad9GpbxoIC2n7YtZt9bumbJNYs3S9T5KBE9Mhn8PC0yyeQl6yDf+hZ2ujnGXh4MBsthgNN8 JEeMCGYXKDXk521lV8aFwJwTzMd1m9ZULcc84LH+k7AoKGTj0zPcz7/FmnIKtxLml0KZQsrlp Danhq6KBKnEEYap0b5MNdQEfxY9UUBiSJUS5/o/tbCJJeM+lDUC9lvsC8htAlT81Fro5fOFVf 4hNkhrXUjvdwgmqSYMsai7SFHZETWDxJjSzbOoJge1jTKuiLRxaOPkfpkm1JUdV1fQZiC5xBq dNT5RAkshDOkyGRsUDXzxtKvVfhuMC62A/pqAbUuW9B43Ns6VheNXqIWleNUea+E+WawDx1jW hFiNlmzIIkLWqL1bCTBjJNAxlxcmGkhCTzZin/un0L/GDnsDEfjHCrAZxXqG9UCEIEMDrSaaj GWv5QC+uebnRbzUyuMTh/XrYMgcl3gpARQfL6QfNkosioDS9h3BxKMw7OEFFTzLMDDlAB60qI ipwIkvc8Y1bFUXFoncIPep9T8xsPxeNu+kDEIld51+aoPRVjHQJYfy+T6BeRGylbceyQwehbl rtva4hWnJpAqkTGfKjhwV5KsWt5YmiQe47mKVm3olCVdD+aAIFwX6HLptgN0ZNLysHIgbG4tY 5APhGA+0szutvW7lTa1RV1Om3Fka+3upF+dzJ71C1tSDpAAisnG8JVW0V/nZNRqGsEmsiBAuV 5/GX+8nff+sk5PiwimjXlL9u6neDYqS6fYTKY0CD8yYI4KXtJ4= 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: Thu, 28 Sep 2017 06:11:57 -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. > > >> 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? While Asterisk is running, it doesn't consume much memory, but stopping Asterisk, I would expect that the claimed memory is freed again. It isn't, not all memory is freed. Starting Asterisk then again from this reduced memory level, it claims its memory, "stabilzes" at a certain point while running and again, stopping Asterisk leaves the free memory now at a much lower level never been leveld out - as I said. I played this game last night ~ 20 times until the free memory dropped beneath 3 GB after asterisk has been shut down. This morning, the level was at the same low level as I left it. The router has nothing special to do, the workload is not memory consuming even for weeks! And if there is load, after the load went away, the memory consumption always leveld out and freed memory. > > 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. I don't understand here. Even if Asterisk is memory hungry - it has ~ 3 GB to use. But after stopping it, it should free the memory. BUT the system is then after the stop with less memory! that is the point. Not the running asterisk's memory consumption bothers me, but the fact, that after 20 start and stops and waiting for days the memory once gone is never put back. At the moment, I have mpg123 suspect doing nasty things, because the vanishing memory is more prominent and indicated when voicemail system has been used and mpg123 started. Not touching VM subsystem seems to free the whole memory claimed by asterisk after stopping asterisk, apart from maybe buffers claimed by the OS released later (I did no thourough investigations on that). > > > > > 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. >