In computer science, Memory Leakage occurs when a computer software or program consumes required memory but unable to memory after completing its task or when no longer needed to Operating System. There are two types of Memory Leakage. One is Virtual Memory Leakage and another is Real Memory Leakage.

 

Now first Identify cached memory or unused memory by executing,

 

# free -m

 
total
used
free
shared
Mem:
3991
2674
1317
0
-/+ buffers/cache:
 
753
3238
 
Swap:
1023
0
1023
 
 

Flush file system buffers by executing,

 

# sync

 

Kernels 2.6.16.x and newer versions of kernel provide a mechanism to have the kernel drop the page cache and/or inode and dentry caches on command, which can be helpful to free up a lot of memory.

 

To free page cache:

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

 

To free dentries and inodes:

# echo 2 > /proc/sys/vm/drop_caches

 

To free page cachedentries and inodes:

echo 3 > /proc/sys/vm/drop_caches

 

Above commands are non-destructive and will only release unused memory. As we have used sync, so it will flush all Dirty Objects which are not free able and make it as unused memory.

zz Release memory in Linux (Unused or Cached)的更多相关文章

  1. [转载]linux 清除系统cached

    FROM: http://cqfish.blog.51cto.com/622299/197230 linux 清除系统cached top查看系统内存使用情况   Mem:    16432180k ...

  2. Linux Buffers和Cached的区别(转)

    在linux下使用free命令查看内存使用情况,有buffers和cached两项,以下是它们的区别: buffers是为块设备设计的缓冲.比如磁盘读写,把分散的写操作集中进行,减少磁盘I/O,从而提 ...

  3. [zz]安装PostgreSQL数据库(Linux篇)

    0.编译环境 Linux: CentOS 5.5 gcc: 4.1.2 1. 安装PostgreSQL 1) 解压postgresql-9.1.7.tar.bz2 #tar jxvf postgres ...

  4. Multi-core compute cache coherency with a release consistency memory ordering model

    A method includes storing, with a first programmable processor, shared variable data to cache lines ...

  5. linux make virtual memory more efficient three components

    Page Cache This is used to speed up access to images and data on disk. As pages are read into memory ...

  6. linux memory dump--http://www.forensicswiki.org/wiki/Tools:Memory_Imaging

    Linux provides two virtual devices for this purpose, '/dev/mem' and '/dev/kmem', though many distrib ...

  7. Memory layout of x86_64 in Linux

    Blue : User Space 128TBRed : Kernel Space 512MBThe rest of the address space goes to various parts o ...

  8. Linux Communication Mechanism Summarize

    目录 . Linux通信机制分类简介 . 控制机制 0x1: 竞态条件 0x2: 临界区 . Inter-Process Communication (IPC) mechanisms: 进程间通信机制 ...

  9. Linux kernel memory-faq.txt

    ## Linux kernel memory-faq.txt What is some existing documentation on Linux memory management? Ulric ...

随机推荐

  1. SQL SERVER 设置自动备份和删除旧的数据库文件

    打开SQL SERVER MANAGEMENT STUDIO,启动SQL SERVER代理服务(注意在“控制面板-管理工具-服务”中设置SQL SERVER AGENT的启动类型为自动).启动后点击“ ...

  2. 推荐图书-《SQL Server 2008商业智能完美解决方案》

    内容简介 <SQL Server 2008商业智能完美解决方案>介绍如何使用Microsoft SQL Server 2008开发商业智能(BI)解决方案.<SQL Server 2 ...

  3. eclipse中Build Path-Add to Build Path相应到androidstudio的设置

    有些时候并不须要加入lib库进行编译,比如在使用xposed的jar包时,仅仅须要在eclipse里Build Path-Add to Build Path就可以,假设作为lib库加入进去反而会出现异 ...

  4. PHP下获取上个月、下个月、本月的日期(strtotime,date)

    今天写程序的时候,突然发现了很早以前写的获取月份天数的函数,经典的switch版,但是获得上月天数的时候,我只是把月份-1了,估计当时太困了吧,再看到有种毛骨悚然的感觉,本来是想再处理一下的,但是一想 ...

  5. javascript类,对象,实例

    在JS中,创建对象(Create Object)并不完全是我们时常说的创建类对象,JS中的对象强调的是一种复合类型一.由一对大括号括起来var emptyObj = {}; var myObj = { ...

  6. 线程2 NSOperation 抽像类的使用

    // // ZYOperationViewController.h // Thread // // Created by yejiong on 14 // // ZYOperation.h // Th ...

  7. android网络请求之POST方法

    package com.jredu.helloworld.activity; import android.os.Bundle; import android.os.Handler; import a ...

  8. Mac OS恢复出厂系统方法

    1.重新启动时按住“Command()”和"R"键盘 2.选择磁盘工具

  9. Ubuntu 14.04 LTS 与Kylin

    现在是安装了Ubuntu 14.04 LTS 但是通过安装ubuntukylin 这个包居然实现了Kylin--原来这个自主研发还这么方便-呵呵 sudo apt-get install ubuntu ...

  10. 关于HTML的总结

    现在最新的Html版本是Html5,以前想在网页中做一个效果很费劲,但是现在Html5对标签都进行了封装,想做效果直接用标签就可以了. 以后百分之百是标签的时代.以后写java 就可以用标签.自定义标 ...