On Friday 29 November 2013 19:37:13 Ođuzhan Zilci wrote: > How can I use background garbage collection? Is there a way to start it > from user space? The only thing I could find about the version of yaffs we > are using is at the top of yaffs_guts.c file: "yaffs_guts.c 2682 2007-01-22 > 03:19:29Z" > Is background gc feature available for this version? You will need a far more recent version to use background gc. Try integrating the current head of the Yaffs2 git. -- Charles > ________________________________________ > From: yaffs [yaffs-bounces@lists.aleph1.co.uk] on behalf of Charles Manning > [cdhmanning@gmail.com] Sent: Thursday, November 28, 2013 11:24 PM > To: yaffs@lists.aleph1.co.uk > Subject: Re: [Yaffs] About nDeletedFiles and nUnlinkedFiles > > On Friday 29 November 2013 03:31:25 Ođuzhan Zilci wrote: > > Dear All, > > > > I'm a very new to YAFFS2 and had little experience on flash file systems. > > We are using YAFFS2 on a 512 MB NAND Chip on an embedded uclinux system. > > After some read/write/delete etc operations on flash, nDeletedFiles and > > nUnlinkedFiles (obtained from /proc/yaffs) becomes about 30k-40k and > > memory footprint of yaffs becomes about 5MB. I test this by running > > "free" command before and after mounting yaffs2. Are we doing something > > wrong, is this an expected value? We are running low on system memory and > > need ever bit of it, can we do some periodic operation (on user space is > > preferred rather then kernel) to check and clean up nDeletedFiles. I > > guess since about 5% to 10% of the flash is used in or system, garbage > > collection mechanism is not started (may be not necessary?), but we need > > something like that. Creating a huge file on flash (about the size of it) > > then deleting it increases free memory again. Any comment, suggestion, > > method, idea is welcomed. > > What is happening is that when files in Yaffs2 are deleted, the objects > still persist in memory until the space where they live is cleared by > garbage collection. > > When you write the large file this forces the garbage collection to happen > and clean up those files. > > It sounds like you are not using background garbage collection. That will > cause the deleted file data to be freed up. > > -- Charles > > _______________________________________________ > yaffs mailing list > yaffs@lists.aleph1.co.uk > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs > > _______________________________________________ > yaffs mailing list > yaffs@lists.aleph1.co.uk > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs