I'm running a homemade linux kernel under VMWARE for Windows.
Even though I've specified that the virtual machine is equipped
with 384MB RAM, VMWARE is smart enough to only allocate the
"truely" allocated memory (the one alloc'd from user space
apps and from the kernel) - around 80MB right after boot.
Unfortunately, as the system goes on running, the kernel is
utilizing the free memory to cache filesystem accesses, and
gradually the VMWARE process (in the windows world) allocates
all the 384MB I've set aside. (In fact, I'm sure that even
right after the boot process completes, a lot of the 80MB
allocated are indeed, cached filedata).
I 'd like to avoid that, by somehow asking the kernel to only use
up to, say, 50MB of filesystem cache. This way my vmware process
(in the windows world) would never "eat" more than 130MB of RAM,
unless I really needed it - that is, unless I run something memory
hungry in the linux virtual machine.
Can I do that?
I tried cat-ing several entries in /proc/sys/vm/ but failed to locate
anything specific (in Google as well).
Thanks in advance for any input...
Same Problem Causing Swap Anguish
The kernel is designed to use all memory. It is considered a waste of memory to have it sit idle, therefore it is all used up with caches and buffers. Try it. Make your memory for the process larger and it will get all used up. On a regular system, if you have 256 MB or you have 1 GB it will all get used up.
Now on some of the later kernels it seems they have done something to keep that from happening if you have 1 GB or more. I don't know for sure, but it seems like it because my Debian machine with 1 GB seems to never dip into swap when I am just using it for surfing and email. So something has been done.
But with 384 MB for the OS and its memory space, it is just going to get all eaten up.
OK, if someone knows a tweak now available and stable, to limit the amount of memory used as cache, please tell us about it.
http://www.linuxforums.org/fo
http://www.linuxforums.org/forum/linux-newbie/527-my-ram-being-eaten.html