Thanks a lot for the response. 

--- On Wed, 1/6/10, Julian Elischer <jul...@elischer.org> wrote:
From: Julian Elischer <jul...@elischer.org>
Subject: Re: Question regarding memory disks
To: "Pieter de Goeje" <pie...@degoeje.nl>
Cc: freebsd-hackers@freebsd.org, "shrivatsan" <shrivat...@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,
>> 
>> 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-unsubscr...@freebsd.org"

_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"




_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to