This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: JFFS2 "eating memory" when creating files
- From: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- To: Andrew Lunn <andrew at lunn dot ch>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Thu, 18 Mar 2004 16:12:41 +0100
- Subject: Re: [ECOS] JFFS2 "eating memory" when creating files
- Organization: Zylin AS
- References: <1078925132.26990.62.camel@famine> <20040318144215.GF31390@lunn.ch>
On Thu, 2004-03-18 at 15:42, Andrew Lunn wrote:
> > After making the attached changes to fs-ecos.c, things are looking much
> > better, but JFFS2 still "eats" 24 bytes every time I open, write and
> > close a file.
>
> Im not sure i like this patch as is.
My patch(or experiment rather) you refer to is now moot.
A different patch was committed to CVS which fixed the memory leak upon
umount:
http://ecos.sourceware.org/ml/ecos-patches/2004-03/msg00040.html
> Question: What happens when you open/write/close the same file again
> and again? Does it use the cached information or does it create a new
> cache entry each time?
In my application code, I unmount+mount JFFS2 when all files are closed
to reduce RAM usage to a minimum.
This trades CPU for memory, which is the right thing for my application.
>Your patch should be controlled by a configuration option which
>controls is the cache is flushed on close and the default should be
>not to flush the cache.
This configurable behaviour would be nice, but I'm not quite sure how to
modify JFFS2 to do so, hence I do the unmount+mount at the application
level.
Ideally, I'd like JFFS2 to keep no caches whatsoever and walk the JFFS2
image for every open, read, write, etc.
Øyvind
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss