- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- how to clear cache memory in linux
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2010 10:25 AM
05-13-2010 10:25 AM
I have a doubt on memory here.
As per the below details.
total used free shared buffers cached
Mem: 8046296 5224000 2822296 0 696388 2917184
Total memory usage is 5224000 which includes (actual usage + cached right)?
If that’s is the case so,
1) What is cached? ( as of I know, it’s used for tmp usage as like swap ) Correct me if I am wrong.
2) Can I clear cache to make my memory usage better?
3) If so, how to clear cache memory.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2010 10:58 AM
05-13-2010 10:58 AM
SolutionInformation for recent/frecuently used data, as file system structures and data.
2) Can I clear cache to make my memory usage better?
The operating system handles that for you. You don't need to manually clear the cache. The OS is very efficient using memory.
Related information:
http://www.cyberciti.biz/faq/linux-kernel-tuning-virtual-memory-subsystem/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2010 05:12 PM
05-13-2010 05:12 PM
Re: how to clear cache memory in linux
>> 1) What is cached? ( as of I know, its used for tmp usage as like swap )
>> Correct me if I am wrong.
Files that are actively used on a system are cached.
i.e. when you access the file form the disk for the first time, it is fetched from
disk. This time it gets copied to cache also. Next time if the same file is
accessed the OS gives you the file from the cache itself. The IO to the disk is
avoided and hence you get performance improvement. Data is got by
accessing the main memory rather than the disk and hence the performance boost.
Generally most Cache's use the LRU mechanism to keep/remove data from
the cache. i.e. the file that gets most actively used will remain in the cache
for more time when compared to other files.
>> 2) Can I clear cache to make my memory usage better?
The OS does this for you. It does the complete cache management and hence
you dont have to worry about it.
However if there are any application that can thrash the cache then you have to
deal with those. By thrashing the cache i mean some bulk disk accessing
operation like backup of disk which would access the entire contents of the
disk and hence would get them in cache. But in doing so the data already in
cache gets knowcked out.
Hope this helps.
Regards,
Murali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2010 09:17 PM
05-13-2010 09:17 PM
Re: how to clear cache memory in linux
From Documentation/sysctl/vm.txt:
drop_caches
Writing to this will cause the kernel to drop clean caches, dentries and
inodes from memory, causing that memory to become free.
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
As this is a non-destructive operation and dirty objects are not freeable, the
user should run `sync' first.
Regards,
Goran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2010 01:10 PM
05-14-2010 01:10 PM