LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Problems with disk cache and ram (https://www.linuxquestions.org/questions/linux-general-1/problems-with-disk-cache-and-ram-303164/)

xvanhessianx 03-18-2005 09:12 AM

Problems with disk cache and ram
 
Im using Novell Linux Desktop 9 (based on Suse) and im having trouble with my disk cache eating up all my system memory. I have 512MB or RAM and dont plan on buying anymore right away. My system monitor tells me that on average i have only about 50 MB of free ram before i go on my swap drive. The disk cache is using up about half of my memory and from what ive been told from my other linux using buddies, it should only use up about 16MB. Im need help on how to change the settings of the cache.

thanks.

Thoreau 03-19-2005 02:06 AM

To quote a hero of mine:

"Let me 'splain. [pause] No, there is too much. Let me sum up..." Ahem.. RAM. OK..
"You keep using that word. I do not think it means what you think it means."

Linux will use all of your RAM. All of it.

It's memory mangement is not the same as windows. It allocates all of your RAM to the OS aka kernel, so it doesn't have to touch your swap. The kernel controls all memory management and allocates it to kernel processes and then userland apps.

The fact that you have any free is a minor miracle. Unlike windows, it will hit your RAM first for anything you do or don't do. If none is left in the entire allocated space, it will use your swap. If you see your swap space filling up or seeing it task, then be concerned. Otherwise it's a non-issue and actually part of what makes linux better than windows.

syg00 03-19-2005 02:12 AM

Shouldn't matter. The fact that you may appear to be approaching total utilization of memory, doesn't mean you will actually soon proceed to using swap space.
Generally you would expect to have the size of the disk cache reduced to accomodate any later higher (program) memory reference. Are you actually seeing any swap utilization, or are you just concerned you might soon ???. If you are swapping, how active does your swap get ???.

Linux prefers memory to swap as it is orders of magnitude faster. Depends on locality of reference, (historical) reference pattern and working set size.

What kernel are you running - 2.6 introduced some user control, but is is a pretty gross adjustment. Gross as in system-wide, not "gross" as in disgusting. ;)

xvanhessianx 03-19-2005 09:50 AM

im not on my swap yet, but im very close to it. this is with just normal desktop usage and superkaramba open. linux kernel 2.6

syg00 03-19-2005 02:50 PM

Non issue.
Keep an eye on it, but as you start programs, the usage wll change to cope. Most (desktop) users appear to see no swapping at all, although some is not "bad". When it gets outrageous, time for more memory.

For example, even with a Gig of memory, I can have in excess of a Gig of swap active.
Not your normal usage, but everything still works fine.

xvanhessianx 03-19-2005 07:42 PM

512kb or ram is good enough for now since im not on the swap yet. i was just curious cause it seemed outragous for linux disk cache to use up half of my memory. anywho as long as its working i guess its best not to f--k with it.


All times are GMT -5. The time now is 03:58 PM.