From owner-freebsd-current@FreeBSD.ORG Fri Aug 24 05:43:37 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08A4F106566B; Fri, 24 Aug 2012 05:43:37 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id CCA8B8FC1C; Fri, 24 Aug 2012 05:43:36 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 5E3074C031D; Fri, 24 Aug 2012 00:43:34 -0500 (CDT) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 5CA5F4C0282; Fri, 24 Aug 2012 00:43:34 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id vGZYHsW8hMxc; Fri, 24 Aug 2012 00:43:34 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id F1AF44C0216; Fri, 24 Aug 2012 00:43:33 -0500 (CDT) Message-ID: <50371485.1020409@rice.edu> Date: Fri, 24 Aug 2012 00:43:33 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Luigi Rizzo References: <20120822120105.GA63763@onelab2.iet.unipi.it> <20120823163145.GA3999@onelab2.iet.unipi.it> <50366398.2070700@rice.edu> <20120823174504.GB4820@onelab2.iet.unipi.it> In-Reply-To: <20120823174504.GB4820@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: alc@freebsd.org, current@freebsd.org Subject: Re: less aggressive contigmalloc ? 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: Fri, 24 Aug 2012 05:43:37 -0000 On 08/23/2012 12:45, Luigi Rizzo wrote: > On Thu, Aug 23, 2012 at 12:08:40PM -0500, Alan Cox wrote: > ... >>> yes i do see that. >>> >>> Maybe less aggressive with M_NOWAIT but still kills processes. >> Are you compiling world with MALLOC_PRODUCTION? The latest version of > whatever the default is. But: > >> jemalloc uses significantly more memory when debugging options are >> enabled. This first came up in a thread titled "10-CURRENT and swap >> usage" back in June. >> >> Even at its most aggressive, M_WAITOK, contigmalloc() does not directly >> kill processes. If process death coincides with the use of >> contigmalloc(), then it is simply the result of earlier, successful >> contigmalloc() calls, or for that matter any other physical memory >> allocation calls, having depleted the pool of free pages to the point >> that the page daemon runs and invokes vm_pageout_oom(). > does it mean that those previous allocations relied on memory overbooking ? Yes. > Is there a way to avoid that, then ? I believe that malloc()'s default minimum allocation size is 4MB. You could reduce that. Alternatively, you can enable MALLOC_PRODUCTION.