[ECOS] JFFS2 "eating memory" when creating files

Øyvind Harboe oyvind.harboe@zylin.com
Thu Mar 18 18:44:00 GMT 2004


I will have to study your writeup more carefully. 

> Using the pooled allocation method for the raw_node_ref structs will save
> 8 bytes per node, which can be substantial. It also avoids heap fragmentation,
> and is more efficient in general. A sound strategy would be to estimate how
> much RAM your program uses for other purposes, and dedicate the rest to
> the pool. And don't worry: if you set it too small, the error you get will
> be exactly the same as if malloc() runs out of heap space during a non-pooled
> allocation.

Lots of modules want to do all their allocation on startup! :-)

Even if I use pools, I'm going to want to unmount JFFS2 when I'm not
using it. I haven't checked, but it wouldn't surprise me to learn that
the JFFS2 pool is allocated as a global variable(i.e. unmounting won't
free it).

My application has various activies which I execute in sequence, and #
of modules * idle ram usage is starting to cause pain.

E.g. I have Lua scripting, but I don't run that at the same time as lwIP
and the ftpd server. All of which hog RAM in idle mode, I think.

Note! I'm not complaining! With the unmount memory leak plugged, things
are lining up nicely!

Ø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



More information about the Ecos-discuss mailing list