Originally Posted By: mlord
The only RAM difference between using a R/W disk and a mostly R/O disk/CF, is for temporary files. Those will occupy RAM in the latter setup. But they are small, and are not saved across reboots. On my little notebook here, they total 2-20MBytes.

Speaking of which, I looked in my notebook here to see exactly what temporary files were being created, (list them all with this: find /.rw/.tmpfs/ -ls).

The biggest culprit turned out to be /lib/modules/*, which for some odd reason always seemed to get a copy of the object file of each loaded kernel module after booting. Weird.

So I looked at the module loader program (/sbin/modprobe), and discovered that it was using O_RDWR when opening the modules for loading, which causes them to be cloned into RAM. So I changed the code to instead use O_RDONLY, and thus saved a decent chunk of RAM.

The rationale for it using O_RDWR looks rather weak -- it wants to lock the file temporarily for something, but that's inherently racey regardless, so what's the point ?

Cheers