From owner-freebsd-current@FreeBSD.ORG Sat Feb 18 08:38:46 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C9ADD16A420; Sat, 18 Feb 2006 08:38:46 +0000 (GMT) (envelope-from b.candler@pobox.com) Received: from thorn.pobox.com (thorn.pobox.com [208.210.124.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC8FF43D49; Sat, 18 Feb 2006 08:38:45 +0000 (GMT) (envelope-from b.candler@pobox.com) Received: from thorn (localhost [127.0.0.1]) by thorn.pobox.com (Postfix) with ESMTP id A5A469C; Sat, 18 Feb 2006 03:39:06 -0500 (EST) Received: from mappit.local.linnet.org (212-74-113-67.static.dsl.as9105.com [212.74.113.67]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by thorn.sasl.smtp.pobox.com (Postfix) with ESMTP id B1388DA08; Sat, 18 Feb 2006 03:39:00 -0500 (EST) Received: from lists by mappit.local.linnet.org with local (Exim 4.60 (FreeBSD)) (envelope-from ) id 1FANbx-000B9K-6w; Sat, 18 Feb 2006 08:38:37 +0000 Date: Sat, 18 Feb 2006 08:38:37 +0000 From: Brian Candler To: Jason Evans Message-ID: <20060218083837.GB42791@uk.tiscali.com> References: <20060215024339.N22450@atlantis.atlantis.dp.ua> <43F29BF5.4060300@freebsd.org> <20060216140725.T23429@atlantis.atlantis.dp.ua> <20060217013427.GB31540@xor.obsecurity.org> <20060217093631.J79078@atlantis.atlantis.dp.ua> <43F5F9BB.6000607@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43F5F9BB.6000607@FreeBSD.org> User-Agent: Mutt/1.4.2.1i Cc: Dmitry Pryanishnikov , Alan Cox , freebsd-current@freebsd.org, Peter Wemm , Kris Kennaway Subject: Re: Virtual memory consumption (both user and kernel) in modern CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 18 Feb 2006 08:38:46 -0000 On Fri, Feb 17, 2006 at 08:28:43AM -0800, Jason Evans wrote: > Yes, it is possible to avoid using large amounts of virtual memory. See > the malloc(3) man page for info on all of the ways that the allocator > can be tuned. In this case, you are looking for the 'k' option. For > instance, if you set /etc/malloc.conf to 'kkkkkk', the allocator will > use a chunk size of 256kB rather than 16MB. > > I would like to change the default chunk size to something in the > 256kB-1MB range, but Peter Wemm has some concerns about how that will > interact with the VM subsystem. The basic problem is that the kernel is > particularly naive about how it coalesces adjacent mappings, so it's > possible to end up with a horribly fragmented virtual memory map. I > don't have the time to fix this problem right now, and I'm not going to > change the default chunk size unless Peter Wemm and/or Alan Cox say it's > okay to do so. Would it be possible to have some sort of "slow start" algorithm? For example, first block allocated is 1MB, next block allocated is 4MB, subsequent blocks are 16MB? I don't know anything about the internal data structures of jemalloc, but if you treat "4MB" as 4 x 1MB and "16MB" as 16 x 1MB, then you'd have effectively a pool of 1MB blocks, but apart from the first few, they'd be allocated contiguously. Regards, Brian.