• 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 / How To / How To Free Up Memory Linux Without Rebooting

How To Free Up Memory Linux Without Rebooting

By Sourabh / August 10, 2024 Category: How To, Ubuntu

If you want to free up memory Linux without rebooting, you can do this by clearing cache and swap memory in Linux Ubuntu using terminal.

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

How Much RAM Is Needed For Ubuntu PC

How To Find Large Files And Directories In Linux Command Line

How To Use Clear Command History In Linux Terminal

Linux Command To Check RAM Size In Ubuntu Terminal In GB

How To Install Proprietary Drivers In Linux Ubuntu Using Terminal

How To Shutdown Linux With A 15 Minute Delay And Message

Free AI Courses With Certificate For Beginners In India

Best AI Plugins For WordPress To Use In 2026

3 Commands To Check USB Connection In Linux Terminal

Linux Terminal Commands for Beginners With Examples

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

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