Skip to main content

Clearing RAM cache and SWAP memory in Linux

If your server get hanged, RAM cache is one of the major reason,. It happens frequently on web server when we are under attack or web developer dosen't consider about performance of application. Miss configuration of servers like mysql and apache is one of the main reason.

We can see ram cache amount on htop, which is user friendly monitoring tool for Linux servers. Because of it we may loss some connections and it's interaction with server. We can do this by our own risk.

What is RAM cache ?

It is a portion of memory made of high-speed static RAM (SRAM) instead of the slower and cheaper dynamic RAM (DRAM) used for main memory. Memory caching is effective because most programs access the same data or instructions over and over.

To clear cache :

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

To clear pagecache change value of echo to 1 on about commend, to clear dentries and inodes change value of echo to 2 on about commend, echo 3 will clear all of three pagecache, dentries and inodes.

To clear swap:

Up-to I know that there is no straight way to this, But we can do it by disable and enable the swap, We can do this by following command,

To turn off : swapoff -a
To turn on : swapon -a 


Popular posts from this blog

Install and Uninstall VMware .bundle in Redhat - RHEL 6

Here the steps for Install and Uninstall VMware .bundle in Redhat and also Linux. I have checked with RHEL 6.

For install :
Login in as root user, Type following command

~]# sh VMware-***.bundle

Here *** will be your software and it's version.

This command will display normal GUI installation. Choose option as your wish.

For Uninstall :
Login in as root user, Type following command

~]# vmware-installer -l

This will display your product name and product version installed by VMware.

Product Name         Product Version    
========== ==============

Note Name and Version, Use following command to uninstall

~]# vmware-installer -u {product-name} {product-version}

~]# vmware-installer -u vmware-workstation

Now you can uninstall with GUI.

* This is common for all VMware .bundle installation files. Ex: VMware-Workstation, VMware-Player etc.

Play NFS (Need For Speed) or other Games on Full Screen in Laptop with Windows 7

Now a days most of people playing NFS serious (NFS Most Wanted , NFS Carbon etc.) in Laptop.

We are facing the problem that NFS game does not play in full screen mode. It have some black bar at both right and left side.

We can fix it with simple steps, For this your video driver should be installed with it's "Graphics & Media Control Panel" application.

Here i have explained it with screen shot. It'll be mostly same for Intel boards. Settings for other video drivers may differ. You may need to search for it in their graphics control panel.

Step 1 :

Click aero button at right bottom corner for show available notifications and running process. There is Graphics & Media Control Panel Icon.
If it is not avaliable there, you can get it from "Windows Control Panel". It'll open your "Graphics & Media Control Panel".

Step 2 :

Click Graphics & Media Control Panel icon and choose Graphics Properties...

Step 3:

Under Intel Graphics and …