LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-08-2015, 06:44 AM   #1
ankitlinux
LQ Newbie
 
Registered: Aug 2015
Posts: 4

Rep: Reputation: Disabled
what is left inside the cache even after clearing the page cache data?


I was trying to clear the cache using

echo 3 > /proc/sys/vm/drop_caches

Even after performing the above operation there remain some space inside the cache? When I check with free -m around it is around 140-150 MB.

What still remain inside the cache which I am not able to drop?
How can I get the information about the remaining pages inside the cache?
 
Old 10-08-2015, 08:20 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Why are you trying to do this? Linux has a very good Memory allocator subsystem.

Perhaps you need to read this http://www.linuxatemyram.com/ ?
 
Old 10-08-2015, 09:57 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
My understanding is that drop_caches merely marks the pages as potentially available, but doesn't move them to the available queue immediately. This is done for (at least) two reasons:
- it is expensive to run the entire queues.
- pages may be requested again soon and can be immediately re-used (a soft page fault).
So other tools may (do) see the pages as "not free" - which doesn't always mean "in use".

What did your investigations of kswapd (as per your other post) reveal ?.
 
Old 10-09-2015, 04:45 AM   #4
ankitlinux
LQ Newbie
 
Registered: Aug 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
As per my understanding drop caches do not drop dirty, write back, anonymous and memory protect pages. which is why they remain inside the page cache.. is there any function inside the page cache implementation using which I can print some metadata about what remains inside the cache or if I can walk through the cache? so that I can know some more information about the pages that we are not able to drop this will be very helpful. Thanks.
 
Old 10-09-2015, 06:06 AM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
There is also pages in there for the running system for open files (including executables). Even if some of these are dropped, they get reloaded nearly immediately before you can even look.
 
  


Reply

Tags
cache, kernel, linux



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between page cache and buffer cache Nayaka Linux - Kernel 5 09-28-2011 08:23 AM
How to see the data content in page cache (ia64, 2.6.9) jupit_29 Linux - Kernel 1 04-06-2011 11:19 PM
clearing CD cache grayFalcon Programming 1 09-21-2006 04:55 PM
clearing cache, web cache on linux varunbihani Linux - General 2 12-08-2005 12:02 PM
clearing cache waxiem Linux - General 1 03-02-2003 09:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration