[ELDK] memory usage in embedded linux

Wolfgang Denk wd at denx.de
Mon Sep 15 20:16:28 CEST 2008


Dear Arun,

In message <bb70857e0809150651k5e3470au1d4aa43802df6218 at mail.gmail.com> you wrote:
> 
> There is small question about memory usage in embedded syste,.

It's a small question maybe, but a difficult one :-)

> Uboot takes 200kb in flash
> Kernel compress image take 2Mb in flash.
> compress Root File system takes 10Mb
> 
> After expending and booting in SDRAM.
> 
> Uboot takes 200Kb (for simple calculation i am putting 1Mb)
> Kernel takes 10Mb for example.
> File system expand to 40Mb.
> 
> It means 51Mb memory used.

Now, it depends. This number is almost certainly incorrect.

First, U-Boot doesn;t use any RAM when Linux is running. It gets wiped
out completely.

Second, file system footprint in RAM depends  a  lot  on  which  file
system you use. Ramdisk is worst, because you always load everything,
and  eventually  even copy it again to execute it. Other file systems
like cramfs have a uch smaller RAM footprint as  only  parts  of  the
software  that  are actually needed have to be loaded into RAM. For a
comparison, see
http://www.denx.de/wiki/view/DULG/RootFileSystemDesignAndBuilding
and
http://www.denx.de/wiki/view/DULG/RootFileSystemSelection

> or How to calculate memory usage for kernel and application and what is safe
> limit.

I am not aware of any generam tool you just run and which then  spits
out  some  number  - you have to carefully investigate each and every
system  configuration  from  ground  up,  studying   all   configured
services,  used  applications,  necessary  error  handling szenarios,
seldom run things like software update tools, etc. 

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It all seemed, he thought, to be rather a lot of  trouble  to  go  to
just sharpen a razor blade.  - Terry Pratchett, _The Light Fantastic_


More information about the eldk mailing list