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 Gym 100418D BOPC 打表找规律,求逆元

    BOPCTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?c ...

  2. C++ Brush

    关键点 实现过程 void CCreateBrushView::OnDraw(CDC* pDC) {     CCreateBrushDoc* pDoc = GetDocument();     AS ...

  3. 分享一个圆角自定义的漂亮AlertDialog

    \res\drawable-hdpi\bg_title_custom_dialog.xml: <?xml version="1.0" encoding="utf-8 ...

  4. iOS开发——UI_swift篇&UITableView实现单元格展开与隐藏

    UITableView实现单元格展开与隐藏  关于UITableView的展开的收缩在前面的文章我已经结束,就是使用代理,通知,block传值的时候实现的,当时是使用一个Bool值来实现,最后使用着三 ...

  5. JavaScript提高:003:easy UI实现tab页面自适应问题

    前面说到使用easyUI在asp.net中实现了tab控件效果.http://blog.csdn.net/yysyangyangyangshan/article/details/38307477只是有 ...

  6. php技术概要汇总

    php搜索-> sphinx     coreseek : 中文分词.中文搜索     samba  :把linux服务器端目录映射的本地. 视频截图插件.音频视频转换(ffmpeg): 1)w ...

  7. js自动提交按钮

    document.forms['alipaysubmit'].submit(); <form id='alipaysubmit' name='alipaysubmit' action='' me ...

  8. python 调用zabbix api接口实现主机的增删改查

    python程序调用zabbix系统的api接口实现对zabbix_server端主机的增删改查,使用相关功能时候,需要打开脚本中的相关函数. 函数说明: zabbixtools()  调用zabbi ...

  9. jboss之mod_cluster集群

    本篇针对的mode_cluster版本是mod_cluster-1.2.6.Final-linux2-x64.tar.gz / mod_cluster-1.2.6.Final-windows-amd6 ...

  10. Oracle 追踪回话SQL几种方法

    生成sql trace可以有以下几种方式: 1.参数设置:非常传统的方法. 系统级别: 参数文件中指定: sql_trace=true 或 SQL> alter system set sql_t ...