From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 31 18:21:12 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 B533F13C; Wed, 31 Oct 2012 18:21:12 +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 A40858FC0C; Wed, 31 Oct 2012 18:21:05 +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 q9VIKwDH011164; Wed, 31 Oct 2012 12:20: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 q9VIKtnR006748; Wed, 31 Oct 2012 12:20: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: <20121030182727.48f5e649@X220.ovitrap.com> <20121030194307.57e5c5a3@X220.ovitrap.com> <615577FED019BCA31EC4211B@Octca64MkIV.tdx.co.uk> <509012D3.5060705@mu.org> <20121030175138.GA73505@kib.kiev.ua> <20121031140630.GE73505@kib.kiev.ua> <20121031172136.GB21003@dan.emsphone.com> Content-Type: text/plain; charset="us-ascii" Date: Wed, 31 Oct 2012 12:20:55 -0600 Message-ID: <1351707655.1120.94.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 , freebsd-hackers@freebsd.org, Alfred Perlstein , Dan Nelson , Karl Pielorz 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: Wed, 31 Oct 2012 18:21:12 -0000 On Wed, 2012-10-31 at 10:55 -0700, Adrian Chadd wrote: > .. isn't the default thread stack size now really quite large? > > Like one megabyte large? That would explain a larger VSZ but the original post mentions that both virtual and resident sizes have grown by almost an order of magnitude. I think the same is true of the jemalloc aspect -- its design makes it use more virtual address space than phkmalloc when you've got lots of threads, but that shouldn't make it use so much more physical memory. I'm not positive of that, but I did notice when we upgraded from 6.x to 8.2 at work, our apps that have many dozens of threads use more virtual space, but not dramatically as much more physical memory as in the OP's case. I think there are some things we should be investigating about the growth of memory usage. I just noticed this: Freebsd 6.2 on an arm processor: 369 root 1 8 -88 1752K 748K nanslp 3:00 0.00% watchdogd Freebsd 10.0 on the same system: 367 root 1 -52 r0 10232K 10160K nanslp 10:04 0.00% watchdogd The 10.0 system is built with MALLOC_PRODUCTION (without that defined the system won't even boot, it only has 64MB of ram). That's a crazy amount of growth for a relatively simple daemon. -- Ian