From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 6 17:35:04 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 D76391065672 for ; Sun, 6 Mar 2011 17:35:04 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5FC9A8FC0A for ; Sun, 6 Mar 2011 17:35:04 +0000 (UTC) Received: by ewy28 with SMTP id 28so1243869ewy.13 for ; Sun, 06 Mar 2011 09:35:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=nps4GO6uTwFVcp+O1fApQAamiS7OAxYk76GjQ6SCdrw=; b=NiFN/Fsp4QhdCEMYVcQT0fKPFbVH8zBVB2URhfVWp7NSNgVFmtvTjwQo/oNjPOKt5t Bs1VLqoDpBNLnIBTQrxdLXEreAXszF1J+WEAqOaKfY1kJZyTG/EUF/eIqyou3Cd9GN8o T21bhBh1qJYRooty5bguECQelR24iZNzb/Kvw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bBq2c7Ouz77FELqqHgdRF4+5QXVAB8l9wNVScWrL1rgf3ZLkSXRR7q+sy/cD/QLkIm ISDqVhyUtoGaka7KY7PsKxcvU2jFeoGvROuA6NwGKe0421a3yWAugmmsf2WIj8ja/V7c 1BCn9XOd1vXM7DLHeOaGxrJZ/AqIFxUI/UBTk= MIME-Version: 1.0 Received: by 10.213.109.72 with SMTP id i8mr1108177ebp.42.1299432903252; Sun, 06 Mar 2011 09:35:03 -0800 (PST) Received: by 10.213.23.13 with HTTP; Sun, 6 Mar 2011 09:35:03 -0800 (PST) In-Reply-To: References: <40A52D4A-9397-4406-A7EC-E7CBBEFADD55@freebsd.org> <4D726887.5080800@rojer.pp.ru> <570723AB-7011-4185-89E1-E02F018DC0C3@ttel.com> Date: Sun, 6 Mar 2011 12:35:03 -0500 Message-ID: From: Ryan Stone To: Vlad Galu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Deomid Ryabkov , Eric Anderson , freebsd-hackers@freebsd.org 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: Sun, 06 Mar 2011 17:35:04 -0000 On Sun, Mar 6, 2011 at 10:34 AM, Ryan Stone wrote: > I would try playing with MALLOC_OPTIONS. =A0I 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. =A0The first thing I would try is setting MALLOC_OPTIONS=3D7h t= o > disable the caching. > Wait, sorry, apparently this is a new option in HEAD. Under 8.1 MALLOC_OPTIONS=3Dg will disable the thread-specific caching. See the malloc(3) man page for the definitive list of available options.