hello Ryan,
1) "It seems writing to the file system (aufs?) shows up as "cached" memory in top."
yes - and this is normal for all linuxes out there, not only porteus. every copying operation leaves it's "shadow" in RAM (a cache) just in case you want to repeat copying the same object to another place.
2) "It is confusing because cached memory is usually freed as needed"
yes - it's designed to work like that.
3) "but this cannot be freed on demand?"
please run 'echo 3 > /proc/sys/vm/drop_caches' to clear your cache completely (but dropping the cache makes no sense to me as per second point)
4) "So the result is I'm unable to tell how much actual free memory is left"
a) if you are using 'changes=' cheatcode then aufs writable branch is set on a real filesystem (not in RAM) so it's enough to run:
Code: Select all
free -m | grep buffers/cache | awk '{print $3}'
and subtract the result (value is present in megabytes) from your total RAM amount.
b) if you are not using 'changes=' cheatcode then you must add amount of RAM taken by applications to amount of RAM taken by aufs, here is the code:
Code: Select all
expr $(expr `free | grep buffers/cache | awk '{print $3}'` + `df | grep aufs | awk '{print $3}'`) / 1024
and subtract the result (value is present in megabytes) from your total RAM amount.
no need to drop the caches at any point to tell how much of free RAM you currently have
5) "In a maybe or maybe not related topic, I custom built a 3.3.3 kernel, just added a few extra features, but I can never get swap space to be used. The system crashes, out of memory, before it will swap. Swap just always shows as 0k used. And yes it is definently on"
i think you are talking about a situation when you are not using a 'changes=' cheat and aufs is filled up completely.
at this point you could get "out of space" error message and system "could crash" as being not able to write anything to /tmp directory (this applies to every other linux as well).
if 'changes=' cheatcode is not used then at the boot time aufs is reserving 60% of RAM (this can be tune-able with ramsize= cheatcode, check /boot/docs/cheatcodes.txt for details) for the "/" (root) partition. this partition has a static size which cannot be expandable with a swap (it acts as every other normal partition).
swapping is done only when necessary so seems that you have filled up "/" (root) partition but system still had enough free memory (40% or RAM) to continue working without swapping.
i have done a simple test on my PC: filled up aufs completely, opened as many apps as i could in kde-4 and ran 'free -m' command just to find that only 46MB were used on the swap partition.
if your hardware is ok then it's really hard to take porteus down

Please add [Solved] to your thread title if the solution was found.