Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The thread doesn't at all clarify why (it is), and actually gives a counter example.

For those who compare the before and after output of 'free', stop it. Yes, the numbers are (sometimes drastically) different. It doesn't matter. The kernel drops pages when it needs a page, and for the general case, this does work. But, as the linked LKML thread states, there may be a pathological case that you are not expected to hit (10 million+ files, and 40 Gigs of ram). For that specific use-case, it did make sense.

The reason this is a bad idea is because dirty pages cannot be freed, which is why it is recommended to run 'sync' first. Unfortunately, on a busy system, pages will get dirty in between the sync and the drop_cache, moreso if you're doing it in a shell. Those dirty pages can then never be reclaimed (due to how drop_caches works, and because drop_caches is only intended for benchmark testing).

(link to same thread but threaded http://lkml.indiana.edu/hypermail//linux/kernel/1009.1/02943...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: