LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Is it possible to disable the disk cache? (https://www.linuxquestions.org/questions/linux-software-2/is-it-possible-to-disable-the-disk-cache-343374/)

sunsfcn 07-15-2005 04:03 AM

Is it possible to disable the disk cache?
 
when I port ArmLinux to a 8MB RAM, I find Cache take a lot of memory.Cache is to speed up disk I/O,but I have no disk .So I want to diable Disk Cache.And how can I do that?

Zeistler 07-15-2005 04:23 AM

Hi

The large cache is caused by the behavior of Linux. Linux will keep old memory pages in memory just in case they are needed again, when you run the same program again for example. The reason for this behavior is that the internal memory is so much faster than the virtual memory on the harddrive that in order to reach maximum performance the internal memory must be used to the max.

I am not aware of any way to change this arrangement. And quite frankly why would you want to? You would take a major hit performance wise.

Zeistler 07-15-2005 04:33 AM

One more thing. Disabling the disk cache is a very bad idea because no matter how much internal memory you may have it will always get full, the reason for this being discribed above. That means that once the internal memory gets full and it always will, Linux will need to have place to put that memory page. If it doesn't have virtual disk memory where it can put it, it will be forced to kill processes who uses a lot of memory just to free space.

This creates major instabillity and danger.

How can you have a disk cache if you don't have a disk by the way???? :confused:

sunsfcn 07-15-2005 09:20 PM

Thanks for your answer.I have 2M flash and 8M SDRAM.I use RAMDISK for root filesystem.When I use Top command ,I find that Cached Memory takes a lot , about 2 MB.I also find it in the /proc/meminfo file.I known I have no hard disks.And I don't know what the Cache memory uses for.


All times are GMT -5. The time now is 02:16 AM.