From owner-freebsd-hackers Thu Nov 8 10: 0:20 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id E5D7D37B405 for ; Thu, 8 Nov 2001 10:00:16 -0800 (PST) Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id JAA76552; Thu, 8 Nov 2001 09:49:54 -0800 (PST) Date: Thu, 8 Nov 2001 09:49:52 -0800 (PST) From: Julian Elischer To: Zhihui Zhang Cc: freebsd-hackers@freebsd.org Subject: Re: Debugging memory leak In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG add your own malloc types (several). and then use them. vmstat -m should show you which of your types are leaking. On Thu, 8 Nov 2001, Zhihui Zhang wrote: > > I am debugging a KLD. After each run, there is always some memory in use > as indicated by vmstat -m. In other words, some memory are still in use by > the KLD. Is there any way to detect the memory leak? > > After I do kldunload, all memory used by it is gone. But I doubt that the > memory is actually returned to the global pool. Probably, it is only the > statistical information is gone. > > Any help or suggestion is appreciated. > > -Zhihui > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message