Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Mac OS X has a pretty cool tool called purge.

You run it at the command line and it frees up all available memory - slowing your system to a halt in the process.

I often free up 2GB of memory or more after running it.

Is this available for Debian/Ubuntu?

share|improve this question

2 Answers 2

up vote 2 down vote accepted


sync; echo 3 > /proc/sys/vm/drop_caches

Edited 8/19/12 to add explanation on drop_caches:

Explanation on drop_caches

Since Kernel 2.6.16, you can control how cache behaves, there are four possible “positions” for the switch.

0 -> Will give the Kernel full control to the cache memory 1 -> Will free the page cache 2 -> Will free dentries and inodes 3 -> Will free dentries and inodes as well as page cache

So, just enter those values to the file /proc/sys/vm/drop_caches, with echo, and as root:

sync; echo 0 > /proc/sys/vm/drop_caches


sync; echo 1 > /proc/sys/vm/drop_caches


sync; echo 2 > /proc/sys/vm/drop_caches


sync; echo 3 > /proc/sys/vm/drop_caches
share|improve this answer


free && sync && echo 3 > /proc/sys/vm/drop_caches && free
share|improve this answer
The OP is asking about purging memory, not installed packages. – terdon Aug 19 '12 at 3:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.