This page was already viewed 4695times
The Random Access Memory (RAM) is a memory, where data used by the CPU are stored temporarly. As this memory provide much faster access than system hard disks, it makes the CPU accessing it much faster and is very important for system performance.
*What is memory cache?The cache memory plays as a data interface between CP and RAM, because it is even faster than RAM memory. it synchronizes with the speed of the CPU, stores data and instructions more frequently accessed by the CPU reducing the amount of RAM accesses and increasing system speed.
There are 3 levels of cache memory to be considered.
When processes uses data, they temorarly store them in RAM, making them quicker to access. This is a good thing since frequently accessed information can be quickly recalled.
The operating system owns directives to determine how long files cached will be keeped in memory, but Linux also gives the user the ability to clear the cache manually. You normally will never need to do this, although there are edge situations where it can come in handy, for example when your system run out of memory unexpectedly.
*What is PageCache?PageCache stores the cached files that were recently accessed, for them not being queried from the hard disk again, unless that file changes or the cache is cleared.
*What are dentry, and inode cache?Dentry and inode cache are directory and file attributes. This is complementary to PageCache. This cache also helps on reducing disk input and ouput operations.
*Clear dentries and inodessystem@linux:#syncsystem@linux:#echo 1 > /proc/sys/vm/drop_caches
*Clear ALL: PageCache, dentries and inodessystem@linux:#syncsystem@linux:#echo 2 > /proc/sys/vm/drop_caches
system@linux:#syncsystem@linux:#echo 3 > /proc/sys/vm/drop_caches
system@linux:#echo '0 0 * * * sync && echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1' >> /etc/crontab