LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what is left inside the cache even after clearing the page cache data? (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-left-inside-the-cache-even-after-clearing-the-page-cache-data-4175555613/)

ankitlinux 10-08-2015 06:44 AM

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?

chrism01 10-08-2015 08:20 PM

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/ ?

syg00 10-08-2015 09:57 PM

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 ?.

ankitlinux 10-09-2015 04:45 AM

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.

jpollard 10-09-2015 06:06 AM

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.


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