From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 29 10:13:59 2008 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 045371065674 for ; Mon, 29 Dec 2008 10:13:59 +0000 (UTC) (envelope-from laladelausanne@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 45D118FC14 for ; Mon, 29 Dec 2008 10:13:57 +0000 (UTC) (envelope-from laladelausanne@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1540848fgb.35 for ; Mon, 29 Dec 2008 02:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=aNSDsAPXYFNrKqJl5g1WZilCL/oKEaO5U1AUG6rOGUo=; b=HSJ3HZXOqyl8qg0xizsJManKoNL7jNnHr3t5FBX/2j+Jn++iy8b3oqv9y1DC37sGkS gjc32g6M1AFNWLN6nEcoJ/4Wd9sP/NAw8ZV1koXNPoZ7ekU5CbQU121Yj0TSxFGkTQ6H 2///vUeKMalSFIzx4+KAW666u5oR4w2CJzSW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=hHJd8Id6kaAHcGgzADNjKxZsoh7nMcLs1TIY2cZE5SHA4mQ/P3pW4iJQQURifnGeXy QVhvCZ5ucTFp5kDxK8+GOZ4xqL4500ajBelbQDkojZJnHQS/5Sjoz+04qhIXuVPLFkN6 mwF9TE0vCEodr2zAHVr9z61v+Dlr62e2okmVg= Received: by 10.86.4.2 with SMTP id 2mr8026430fgd.4.1230545636910; Mon, 29 Dec 2008 02:13:56 -0800 (PST) Received: from nslpc5.epfl.ch (nslpc5.epfl.ch [128.178.149.20]) by mx.google.com with ESMTPS id 12sm19221739fgg.36.2008.12.29.02.13.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 29 Dec 2008 02:13:55 -0800 (PST) Message-Id: From: =?ISO-8859-2?Q?Nikola_Kne=BEevi=E6?= To: freebsd-hackers@freebsd.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Mon, 29 Dec 2008 11:13:53 +0100 References: <623D1024-5DA0-4252-8DA9-FA86E0407DA8@gmail.com> X-Mailer: Apple Mail (2.930.3) Subject: Re: debugging mbuf allocation/dealocation 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: Mon, 29 Dec 2008 10:13:59 -0000 > > You can use the KTR(4) facility to trace memory allocations and > deallocations, logging them to memory, disk, etc. Unfortunately > interpreting the data can be fairly tricky, as network leaks tend to > happen over a long period of time, be stored in sockets, etc, but > it's definitely possible and has been done. :-) Processing the > results with a perl script goes a long way, as the allocated/freed > pointers are included, etc. Hi Robert, thanks for the pointers :) I discovered that root cause of the leakage - Click::Packet had a bad destructor, which wasn't free-ing mbufs all the time. Since there are some other forms of leaking in Click, I'll use KTR do discover them. Cheers, Nikola