I have RHEL4 kernel 2.6.9-5ELsmp. The system has 8 GB RAM. After boot and starting all processes the system shows about 7.3 GB free, 50 MB inactive and 350 MB active or somewhere thereabouts. The system will be fine (vmstat 3, top, free, swap -l) for a long time if left alone. Then when you access a file (cp, tar, cat, etc.) The “cached” (visible in vmstat and free) memory grows. Some of this is added to “active” and some to “inactive”. All the while, it never returns to “free” (even after sync). It stays cached.
I think this is normally fine, except that reading files that have already been read add to cached and cached seems to grow by 2X file size for cp/mv (like it caches it for each file system). The system has been up for 12 hours now and cached is up to 2.5 GB.
It seems to be growing out of control and I can’t free any of it. If it keeps growing the system will (and previously has) run out of RAM. In HP-UX you can limit this setting. Can you limit it in RedHat? Is there something else I can do?
Thanks for your help.