• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / Ubuntu / How To Clear Buff Cache Memory In Linux

How To Clear Buff Cache Memory In Linux

By Sourabh / November 19, 2024 Category: Ubuntu

This post explains how to clear buff/cache memory in Linux to free up memory in Linux without rebooting.

Before you clear memory in Linux to free resources and free memory without rebooting, you must understand that a buffer is an area of memory used to temporarily store data while being moved from one place to another. Whereas, a cache is a temporary storage area to store frequently accessed data for rapid access.

The cache in Linux is called Page Cache and the Linux cache approach is called a write-back cache.

See Buffer and Cache Memory Details in Linux

To analyze the amount of system memory and the memory allocated to buffer and cache of the said system, use the free command:

free -m

Clear Memory In Linux

To clear pagecache only:

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

To clear dentries and inodes:

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

To clear pagecache, dentries and inodes:

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

You can also use the following chain of commands to empty buffer and cache:

free && sync && echo 3 > /proc/sys/vm/drop_caches && free

NOTE:

  • use echo 1 to free page cache:
  • use echo 2 to free dentries and inodes:
  • use echo 3 to free page cache, dentries, and inodes:

Clear RAM In Linux

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

sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove

Clear Swap Memory In Linux

swapoff -a && swapon -a

That’s all for now.

Primary Sidebar

Latest Posts

Ubuntu 25.04 ‘Plucky Puffin’ Is Available To Download

How to Login as Root User in Linux Terminal

Install Firefox In Ubuntu Terminal Command Line

How To Check Kernel Installed Date In Linux Ubuntu

How To List All Kernel Modules That Are Loaded In Ubuntu

Enable Ubuntu Auto Login Without Password

Download Ubuntu 25.04 Official Default Wallpapers

How To Fix Initramfs Error In Ubuntu Command Line

How To Check All Available Kernel Version In Linux Ubuntu

3 Best Artificial Intelligence Domain Name Generators

© 2025 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap