LFCS drop_caches Practice Question
A Linux system reports 'Out of memory' errors frequently. The administrator checks memory usage with 'free -m' and notices that most memory is used by file cache. Which command can the administrator run to immediately free up the cache without affecting running processes?
⚠ Common exam trap
The trap is that some candidates think only echo to /proc is valid, but sysctl vm.drop_caches=1 is an equally correct alternative. Others may incorrectly believe swapoff -a or killing processes will free cache.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
sysctl vm.drop_caches=1
Both options A and C are correct methods to free pagecache (file cache) without terminating processes. Writing to /proc/sys/vm/drop_caches via echo or using the sysctl command achieve the same result. The administrator can use either command to immediately reclaim memory used by file cache. Option B disables swap but does not free cache, and option D kills a process unnecessarily.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
sysctl vm.drop_caches=1
Why this is correct
Correct. sysctl vm.drop_caches=1 is a valid command to drop pagecache, functionally equivalent to writing to the proc file.
- ✗
swapoff -a
Why it's wrong here
Incorrect. swapoff -a disables swap space but does not free file cache.
- ✓
echo 1 > /proc/sys/vm/drop_caches
Why this is correct
Correct. echo 1 > /proc/sys/vm/drop_caches explicitly frees pagecache, which is the typical method referred to in documentation.
- ✗
kill -9 $(pidof some_process)
Why it's wrong here
Incorrect. Killing a process is not required and may disrupt services; it does not directly free cache.
Go deeper
Related to this question
About these practice questions
This LFCS question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.