From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 8 03:27:29 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31638106566B for ; Tue, 8 Mar 2011 03:27:29 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id D77748FC0C for ; Tue, 8 Mar 2011 03:27:28 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pwna3-0007e5-Dx for freebsd-hackers@freebsd.org; Tue, 08 Mar 2011 04:27:27 +0100 Received: from cpe-188-129-84-115.dynamic.amis.hr ([188.129.84.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Mar 2011 04:27:27 +0100 Received: from ivoras by cpe-188-129-84-115.dynamic.amis.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Mar 2011 04:27:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Tue, 08 Mar 2011 04:27:07 +0100 Lines: 19 Message-ID: References: <40A52D4A-9397-4406-A7EC-E7CBBEFADD55@freebsd.org> <4D726887.5080800@rojer.pp.ru> <570723AB-7011-4185-89E1-E02F018DC0C3@ttel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpe-188-129-84-115.dynamic.amis.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101102 Thunderbird/3.1.6 In-Reply-To: Subject: Re: Mem leak : malloc/free + pthreads = leakage? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 03:27:29 -0000 On 06/03/2011 18:35, Ryan Stone wrote: > On Sun, Mar 6, 2011 at 10:34 AM, Ryan Stone wrote: >> I would try playing with MALLOC_OPTIONS. I seriously doubt that there >> is an actual leak in jemalloc, but from my own experiences with it I >> suspect that there are certain multithreaded malloc/free sequences >> that interact badly with with the per-thread caching that jemalloc >> performs. The first thing I would try is setting MALLOC_OPTIONS=7h to >> disable the caching. >> > > Wait, sorry, apparently this is a new option in HEAD. Under 8.1 > MALLOC_OPTIONS=g will disable the thread-specific caching. See the > malloc(3) man page for the definitive list of available options. I can confirm this suspicion; I have an malloc-intensive multithreaded program on 8-STABLE which I need to run with MALLOC_OPTIONS g10f2n to reduce otherwise severe memory lossage by the allocator. I haven't tried it on 9, though.