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. Codeforces Round #250 (Div. 1) D. The Child and Sequence 线段树 区间取摸

    D. The Child and Sequence Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest ...

  2. Codeforces Round #326 (Div. 2) B. Duff in Love 分解质因数

    B. Duff in Love Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/588/proble ...

  3. 使用Active MQ在.net和java系统之间通信

    ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线.ActiveMQ 是一个完全支持JMS1.1和J2EE 1.4规范的 JMS Provider实现 一.特性列表 ⒈ 多种语言和 ...

  4. hive-0.10.0-cdh4.3.0安装

    1.我使用的Hadoop2.0-cdh4.3.0,相应hive配套版本号hive-0.10.0-cdh4.3.0.    2.改动hive/conf下hive-site.xml文件,无则创建hive- ...

  5. Swift常用语法示例代码(一)

    此篇文章整理自我以前学习Swift时的一些练习代码,其存在的意义多是可以通过看示例代码更快地回忆Swift的主要语法. 如果你想系统学习Swift或者是Swift的初学者请绕路,感谢Github上Th ...

  6. string 对象及其操作

    标准库类型string 标准库类型string表示可变长的字符序列,使用string类型必须首先包含string头文件.作为标准库的一部分,string定义在命名空间std中.接下来的示例都假定了已包 ...

  7. No identifier specified for entity

    主键问题   使用hibernate的e-r映射pojo类的时候遇到org.hibernate.AnnotationException: No identifier specified for ent ...

  8. 10+ commonly using find command switches with example Unix/Linux

    http://crybit.com/find-command-usage-with-example-unixlinux/ find command is one of the best search ...

  9. Boxes in a Line

    Boxes in a Line You have n boxes in a line on the table numbered 1 . . . n from left to right. Your ...

  10. hadoop学习记录(一)HDFS

    hadoop的灵感源于谷歌,最初目的是解决传统数据库处理数据成本高和速度慢的问题. hadoop两个核心项目是HDFS(hadoop分布式文件系统)和MapReduce. HDFS用来实现数据的存储, ...