Query: Embedded System - Total Memory Usage
We have an embedded system here, where we are running everything from RAM. We use CPIO file systems that get loaded into RAM as part of the Kernel image and is mounted as a ramdisk.
Our system has 128M of RAM. We "remove" from the system ~ 28M that we map (physically) for certain needs. That leaves Linux with ~ 100M. When our applications run (and loads libraries/modules, etc), "free" reports how much is used: ~ 44MB.
Yet, I still have a File System occupying Memory that does NOT see to get reported by "free". The uncompressed File system image is ~ 23M
My questions are:
1. How can I determine how much RAM is used by the File System? This would, I believe, need to be added to the "used" memory reported by "free" to determine "total memory used" in the system.
2. Why does free NOT report how much is used by the Filesystem? Since it needs to be there, one would think that it needs to be reported. I find the current "free" implementation to be flawed in this way, since this does reside in memory.
In systems where one mounts the file system on a disk, then yes, I would agree that free reports memory usage accurately.
3. If my application started to use up more memory, at what point would I expect to run into trouble? For example:
Avail Mem = 100M
FileSys = 25M
Running kernel/modules/drivers/libs/apps = 50M
In reality, of 100M, I "really" only have 75M since my FS resides in RAM. So using 50/100 is 50% used where as 50/75 is 67% used, BIG difference.
Would my app be able to use up to 75M or would it use up to 100M? What happens to the FS? Wouldn't something get overwritten? Would the kernel crash, or maybe die gracefully?
I know that the FS won't grow beyond what gets specified when it's built.
TIA for your insights into this, it is greatly appreciated.