From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 3 17:48:06 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D6D8D4C; Sat, 3 Nov 2012 17:48:06 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 3A0598FC15; Sat, 3 Nov 2012 17:47:58 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qA3HlwST035914; Sat, 3 Nov 2012 11:47:58 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qA3HltXb010080; Sat, 3 Nov 2012 11:47:55 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: Threaded 6.4 code compiled under 9.0 uses a lot more memory?.. From: Ian Lepore To: Adrian Chadd In-Reply-To: References: <615577FED019BCA31EC4211B@Octca64MkIV.tdx.co.uk> <509012D3.5060705@mu.org> <20121030175138.GA73505@kib.kiev.ua> <20121031140630.GE73505@kib.kiev.ua> <20121031172136.GB21003@dan.emsphone.com> <1351707655.1120.94.camel@revolution.hippie.lan> <20121031190623.GL73505@kib.kiev.ua> Content-Type: text/plain; charset="us-ascii" Date: Sat, 03 Nov 2012 11:47:54 -0600 Message-ID: <1351964874.1120.73.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Konstantin Belousov , Karl Pielorz , Alfred Perlstein , Dan Nelson , freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 17:48:06 -0000 On Wed, 2012-10-31 at 13:38 -0700, Adrian Chadd wrote: > On 31 October 2012 12:06, Konstantin Belousov wrote: > > > Watchdogd was recently changed to mlock its memory. This is the cause > > of the RSS increase. > > > > If not wired, swapout might cause a delay of the next pat, leading to > > panic. > > Right, but look at the virtual size of the 6.4 process. It's not 10 > megabytes at all. Even if you wired all of that into memory, it > wouldn't be 10 megabytes. > > > > Adrian After gathering some more evidence, I agree that the huge increase I noticed in watchdogd is caused by a combo of jemalloc's behavior and the recent addition of mlockall(2) to watchdogd. Since this is only slightly tangentially related to the OP's questions as near as I can tell, I've entered a PR for it[1], and we can followup with a separate discusssion thread about that. While jemalloc can explain the growth in VSZ between 6.4 and 9.x, it doesn't look like mlockall() has anything to do with the original question of why the RSZ got so much bigger. In other words, part of the original question is still unanswered. [1] http://www.freebsd.org/cgi/query-pr.cgi?pr=173332 -- Ian