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. OpenCV 2.2版本号以上显示图片到 MFC 的 Picture Control 控件中

    OpenCV 2.2 以及后面的版本号取消掉了 CvvImage.h 和CvvImage.cpp 两个文件,直接导致了苦逼的程序猿无法调用里面的显示函数来将图片显示到 MFC 的 Picture Co ...

  2. 发布站点到远程FTP根目录

    第一步:修改 phpcms/modules/admin/templates/site_add.tpl.php 找到 <legend><?php echo L('release_poi ...

  3. mybatis0211 mybatis和spring整合

    1mybatis和spring整合 1.1 mybaits和spring整合的思路 .让spring管理SqlSessionFactory .让spring管理mapper动态代理对象和dao. 使用 ...

  4. rabbitmq——用户管理

    安装最新版本的rabbitmq(3.3.1),并启用management plugin后,使用默认的账号guest登陆管理控制台,却提示登陆失败. 翻看官方的release文档后,得知由于账号gues ...

  5. Calendar Game

    http://poj.org/problem?id=1082 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4820   A ...

  6. Org-mode 任务添加提醒

    org-mode中的约会日程有提醒功能,这样设置就行: ;; ;;; 提醒 ;; (require 'appt) ;; (appt-activate t);启用约会提醒 ;; (setq appt-d ...

  7. android文件系统挂载分析(1)---正常开机挂载

    未完,更新中 ... "android"系列分为三部分: 1.正常开机挂载 2.encryption 3.dm-verity 我们知道android有很多分区,如"sys ...

  8. UVA 539 The Settlers of Catan dfs找最长链

    题意:画边求最长链,边不能重复数点可以. 很水,用暴力的dfs即可,因为数据不大. 本来以为可以用floyd进行dp的,后来想想好像不能在有回路上的图跑...于是没去做. #include <c ...

  9. oracle--clob

    最近,收到这样的异常邮件: Error updating database.  Cause: java.sql.SQLException: ORA-01461: can bind a LONG val ...

  10. FZU 1686 神龙的难题 (DLX)

    神龙的难题 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status ...