From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 7 01:31:27 2010 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 BABFB1065670 for ; Thu, 7 Jan 2010 01:31:27 +0000 (UTC) (envelope-from julian@elischer.org) Received: from utility-0.aerioconnect.net (utility-0.aerioconnect.net [216.240.32.11]) by mx1.freebsd.org (Postfix) with ESMTP id 7BC0B8FC0A for ; Thu, 7 Jan 2010 01:31:27 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by utility-0.aerioconnect.net (8.13.1/8.13.1) with ESMTP id o070RA1U010660; Wed, 6 Jan 2010 16:27:10 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id C6C4F2D6012; Wed, 6 Jan 2010 16:27:09 -0800 (PST) Message-ID: <4B452A5D.4000208@elischer.org> Date: Wed, 06 Jan 2010 16:27:09 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Pieter de Goeje References: <5a13b8941001061349m701d17fbl489ec8cf883e8c3c@mail.gmail.com> <201001070017.36855.pieter@degoeje.nl> In-Reply-To: <201001070017.36855.pieter@degoeje.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, shrivatsan Subject: Re: Question regarding memory disks 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: Thu, 07 Jan 2010 01:31:27 -0000 Pieter de Goeje wrote: > On Wednesday 06 January 2010 22:49:44 shrivatsan wrote: >> Hi, >> >> I have configured a malloc-backed memory disk, and I mount the device on to >> the file system. I write some data onto the file system. I see that the >> free memory indicated by kmem_map_free goes down, and this is proportional >> to the size of the data written. However, even after removing all the >> data, kmem_map_free doesn't seem to go up. Its only after detaching the >> memory disk does the free memory go up. May I know the reason for this >> behavior? >> >> >> Thanks, >> -shrivatsan > > Because when you "erase" something, all it does is unlink (delete the > reference to) the data. So there is currently no way the memory disk can free > the memory associated with the data. That is also why you should normally use > swap backed memory disks instead, or use tmpfs. These can return memory to > the system. > > The ability of the filesystem to mark certain blocks as "erased" is important > not only for memory disks but also for solid state drives. It is a feature > UFS2 is currently lacking unfortunately. but is being worked on > > - Pieter > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"