Truemag

  • Categories
    • Tips And Tricks
    • Internet
    • PHP
    • Javascript
    • CSharp
    • SQL Server
    • Linux
  • Lastest Videos
  • Our Demos
  • About
  • Contact
  • Home
  • Write With Us
  • Job Request
Home Linux Ubuntu CentOS Clear Filesystem Memory Cache

Ubuntu CentOS Clear Filesystem Memory Cache

In this tutorial, I will show you how to free up as much memory as possible by using a very simple command in Linux, it’s may applied on Ubuntu, CentOS, openSUSE or any Unix system. By using this command, you don’t need to normally reboot your server to clear the cache from the memory.

First, you should check your current memory usage by using command below:

$ free -m

$ free -m

There are 3 ways to help you free up a lot of memory, you can use either of following methods:

1. Free pagecache

$ echo 1 > /proc/sys/vm/drop_caches

$ echo 1 > /proc/sys/vm/drop_caches

2. Free dentries and inodes

echo 2 > /proc/sys/vm/drop_caches

echo 2 > /proc/sys/vm/drop_caches

3. Free pagecache, dentries and inodes

echo 3 > /proc/sys/vm/drop_caches

echo 3 > /proc/sys/vm/drop_caches

All of them are quite easy but I always choose command number 3 for my server. You can create a cron job in your system to automatically free up your memory at a time specified.

After run one of 3 commands above, you should run free -m to check how it works.

Mar 23, 2011Hoan Huynh
Get System Information: CPU, RAM, Hard Disks, VGA Card with Msinfo32.exe On Windows 7Excerpt box disappeared on Wordpress New Version
You Might Also Like:
  • Install CentOS in VirtualBox
  • CentOS install PHP Json Extension by using PECL
  • Tips For Tuning And Optimizing Mysql On Low Memory Dedicated Server Or VPS
  • Linux CentOS view live website access log with tail command
  • Check Version, Processor And Memory In MacBook
  • centos -bash pecl command not found
  • Install LAMP (Apache, MySQL and PHP in Linux) on CentOS
  • How To Clear Cache On Internet Explorer 8, Firefox 4 And Google Chrome 10
  • Mysql Create FullText Index and Load Index Into Cache
  • Linux Find Out PHP/ MySQL/ MySQLD/ HTTPD … Command File Location
Hoan Huynh

Hoan Huynh is the founder and head of 4rapiddev.com. Reach him at [email protected]

11 years ago Linuxlinux command, Memory319
0
GooglePlus
0
Facebook
0
Twitter
0
Digg
0
Delicious
0
Stumbleupon
0
Linkedin
0
Pinterest
Most Viewed
PHP Download Image Or File From URL
24,469 views
Notepad Plus Plus Compare Plugin
How To Install Compare Text Plugin In Notepad Plus Plus
21,844 views
Microsoft SQL Server 2008 Attach Remove Log
Delete, Shrink, Eliminate Transaction Log .LDF File
17,661 views
JQuery Allow only numeric characters or only alphabet characters in textbox
15,004 views
C# Read Json From URL And Parse/Deserialize Json
11,737 views
4 Rapid Development is a central page that is targeted at newbie and professional programmers, database administrators, system admin, web masters and bloggers.
Recent Posts
  • Things to Learn about Installingderm Loan Type S
  • Online Photo Editor – Free Photoediting Software
  • A Guide to Finding the Best Paper Sellers
  • Photoediting in Home Isn’t Hard to Do!

  • Free Photo Editor Online
Categories
  • CSharp (45)
  • Facebook Graph API (19)
  • Google API (7)
  • Internet (87)
  • iPhone XCode (8)
  • Javascript (35)
  • Linux (27)
  • MySQL (16)
  • PHP (84)
  • Problem Issue Error (29)
  • Resources (32)
  • SQL Server (25)
  • Timeline (5)
  • Tips And Tricks (141)
  • Uncategorized (647)
Recommended
  • Custom Software Development Company
  • Online Useful Tools
  • Premium Themes
  • VPS
2014 © 4 Rapid Development