From owner-freebsd-hackers@FreeBSD.ORG Sun May 23 12:50:02 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from green.homeunix.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id BC3EE16A4CE; Sun, 23 May 2004 12:50:01 -0700 (PDT) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.12.11/8.12.11) with ESMTP id i4NJo1O3076070; Sun, 23 May 2004 15:50:01 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.12.11/8.12.11/Submit) id i4NJo1lV076069; Sun, 23 May 2004 15:50:01 -0400 (EDT) (envelope-from green) Date: Sun, 23 May 2004 15:50:00 -0400 From: Brian Feldman To: "M. Warner Losh" Message-ID: <20040523195000.GB75871@green.homeunix.org> References: <000701c4402b$a54e73d0$4206000a@stalker> <40AFA163.4020109@freebsd.org> <20040522.223042.41645314.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040522.223042.41645314.imp@bsdimp.com> User-Agent: Mutt/1.5.6i cc: hackers@FreeBSD.org Subject: Re: Memory Leak X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2004 19:50:02 -0000 On Sat, May 22, 2004 at 10:30:42PM -0600, M. Warner Losh wrote: > Any suggestions for leak detectors that work in real-time or in > response to some external signal? In a threaded application would be > ideal. > > I've hacked malloc to add the stack traceback to the utrace info > that's output by malloc. However, for applications that run for days, > and tend to allocate and free a lot of memory, you gotta have lots of > local storage. The restrictions in the kernel that requires this to > be a real file makes it harder. > > Also, there's a difference between what's in use and what is leaking.. Try boehm-gc; I run the following local patch to the ports to fix a few things and let me enable compile options from the ports infrastructure. You can call the detector at any time to see if any leaks have occurred made. -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\