Date: Thu, 7 Jan 2010 10:08:29 -0800 (PST) From: Shrivats <shrivatsan_v@yahoo.com> To: Pieter de Goeje <pieter@degoeje.nl>, Julian Elischer <julian@elischer.org> Cc: freebsd-hackers@freebsd.org, shrivatsan <shrivatsan@gmail.com> Subject: Re: Question regarding memory disks Message-ID: <670994.29087.qm@web112004.mail.gq1.yahoo.com> In-Reply-To: <4B452A5D.4000208@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks a lot for the response.=A0 --- On Wed, 1/6/10, Julian Elischer <julian@elischer.org> wrote: From: Julian Elischer <julian@elischer.org> Subject: Re: Question regarding memory disks To: "Pieter de Goeje" <pieter@degoeje.nl> Cc: freebsd-hackers@freebsd.org, "shrivatsan" <shrivatsan@gmail.com> Date: Wednesday, January 6, 2010, 7:27 PM Pieter de Goeje wrote: > On Wednesday 06 January 2010 22:49:44 shrivatsan wrote: >> Hi, >>=20 >> 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 proportion= al >> 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? >>=20 >>=20 >> Thanks, >> -shrivatsan >=20 > Because when you "erase" something, all it does is unlink (delete the ref= erence 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 u= se swap backed memory disks instead, or use tmpfs. These can return memory = to the system. >=20 > The ability of the filesystem to mark certain blocks as "erased" is impor= tant not only for memory disks but also for solid state drives. It is a fea= ture UFS2 is currently lacking unfortunately. but is being worked on >=20 > - 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= " _______________________________________________ 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" =0A=0A=0A
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?670994.29087.qm>