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. Linux 内核动态函数调用可视化工具

    要求: python .7以上 https://www.python.org/ftp/python/ EG:wget --no-check-certificate https://www.python ...

  2. 网络IPC:套接字之带外数据

    带外数据(Out-of-band data)是一些通信协议所支持的可选特征,允许更高优先级的数据比普通数据优先传输.即使传输队列已经有数据,带外数据先行传输.TCP支持带外数据,但是UDP不支持.套接 ...

  3. 从B树、B+树、B*树谈到R 树

    从B 树.B+ 树.B* 树谈到R 树 作者:July.weedge.Frankie.编程艺术室出品. 说明:本文从B树开始谈起,然后论述B+树.B*树,最后谈到R 树.其中B树.B+树及B*树部分由 ...

  4. Linux内核--网络栈实现分析(一)--网络栈初始化--转

    转载地址 http://blog.csdn.net/yming0221/article/details/7488828 作者:闫明 本文分析基于内核Linux Kernel 1.2.13 以后的系列博 ...

  5. 关于删除linux多余内核

    step 1: 查找当前正在使用的内核文件的版本号 #uname -r step 2: 列出所有的内核文件,使用rpm 或者 dpkg(基于linux系统) 命令  #rpm -q kernel 或者 ...

  6. Linux 学习笔记 文件权限

    * Linux系统会为各种各样的功能创建不同的用户账户,而这些账户并不是真的用户.这些账户称作系统账户,是系统上运行的各种服务进程访问资源用的特殊账户. 所有运行在后台的服务都需要用一个系统用户账户登 ...

  7. C语言第四节数据类型、常量、变量

    数据 什么是数据 生活中时时刻刻都在跟数据打交道,比如体重数据.血压数据.股价数据等.在我们使用计算机的过程中,会接触到各种各样的数据,有文档数据.图片数据.视频数据,还有聊QQ时产生的文字数据.用迅 ...

  8. css笔记13:display用法

    1.代码演示: element.html如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...

  9. android网络请求之POST方法

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

  10. SQL Server2008附加数据库失败

    今天旁晚时分,我准备把老师在上课时候发给我们的一个数据库附加到我的SQL Server2008上面去,本来在学校机房用的SQL Server2000是很顺利地就成功了,但是把*.mdf文件附加到我的0 ...