# Clearing caches from memory

**URL:** <https://linux-tips.com/t/clearing-caches-from-memory/202>\
**Category:** Kernel\
**Created:** [August 23, 2008, 2:05pm UTC](https://linux-tips.com/t/clearing-caches-from-memory/202 "2008-08-23T14:05:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![demirten](https://linux-tips.com/user_avatar/linux-tips.com/demirten/32/64_2.png) [@demirten](https://linux-tips.com/u/demirten)\
**Post date:** [August 23, 2008, 2:05pm UTC](https://linux-tips.com/t/clearing-caches-from-memory/202/1 "2008-08-23T14:05:14Z")

</div>

From version 2.6.16 Linux kernel has a tunable parameter named  
_/proc/sys/vm/drop\_caches_

If you want to force to clear pagecaches from memory use:

```
echo 1 > /proc/sys/vm/drop_caches

```

If you want to clear dentry and inode caches from memory:

```
echo 2 > /proc/sys/vm/drop_caches

```

and if you want to clear both of the pagecaches and dentry and inode caches just use:

```
echo 3 > /proc/sys/vm/drop_caches

```

In order to make sure all cached objects are freed you must execute the `sync` command first.
