zz Release memory in Linux (Unused or Cached)
|
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 |
||||||||||||||||||||
|
||||||||||||||||||||
|
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 cache, dentries 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)的更多相关文章
- [转载]linux 清除系统cached
FROM: http://cqfish.blog.51cto.com/622299/197230 linux 清除系统cached top查看系统内存使用情况 Mem: 16432180k ...
- Linux Buffers和Cached的区别(转)
在linux下使用free命令查看内存使用情况,有buffers和cached两项,以下是它们的区别: buffers是为块设备设计的缓冲.比如磁盘读写,把分散的写操作集中进行,减少磁盘I/O,从而提 ...
- [zz]安装PostgreSQL数据库(Linux篇)
0.编译环境 Linux: CentOS 5.5 gcc: 4.1.2 1. 安装PostgreSQL 1) 解压postgresql-9.1.7.tar.bz2 #tar jxvf postgres ...
- 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 ...
- 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 ...
- 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 ...
- Memory layout of x86_64 in Linux
Blue : User Space 128TBRed : Kernel Space 512MBThe rest of the address space goes to various parts o ...
- Linux Communication Mechanism Summarize
目录 . Linux通信机制分类简介 . 控制机制 0x1: 竞态条件 0x2: 临界区 . Inter-Process Communication (IPC) mechanisms: 进程间通信机制 ...
- Linux kernel memory-faq.txt
## Linux kernel memory-faq.txt What is some existing documentation on Linux memory management? Ulric ...
随机推荐
- QM04-生产中的QM
集成的计划 生产过程中的生产工序和检验工序逐渐变得更为相互依赖或者说被组合在一起.从而使来自生产和质量检验领域的工作小组共同创建工艺流程. 检验工序 可以把QM检验特性集成到生产计划(PP)模块的工作 ...
- Unity3D脚本--经常使用代码集
1. 訪问其他物体 1) 使用Find()和FindWithTag()命令 Find和FindWithTag是很耗费时间的命令,要避免在Update()中和每一帧都被调用的函数中使用.在Start() ...
- ResolveClientUrl("~/Styles/Site.cs")%>
区别: <%=ResolveClientUrl("~/Styles/Site.cs")%> 和 <%=ResolveUrl("~/Styles/Site ...
- strcpy_s与strcpy的比較
strcpy_s和strcpy()函数的功能差点儿是一样的.strcpy函数,就象gets函数一样,它没有方法来保证有效的缓冲区尺寸,所以它仅仅能假定缓冲足够大来容纳要拷贝的字符串.在程序执行时,这将 ...
- fscanf()函数具体解释
曾经解析有规律的文件的时候要么用正則表達式,要么就是傻傻的自己敲代码来解析有规律的文件.今天突然发现c的库函数中有一个现成的能够解析有规律的文件的函数,就是fscanf()函数.哎 曾经自己做了这么多 ...
- 阿里技术嘉年华(ADC2013)总结与感悟
上周末刚参加了ADC2013(2013.7.13-14),我报的是TCon测试论坛和UCAN用户体验设计论坛,因为我目前从事的是测试工作,但是还是想往用户体验(主要是用研)方向发展,所以 ...
- 修改mac os分辨率(VMware)
转自:http://hi.baidu.com/hehonglei123/item/55591c17e7991d582a3e22a1 1. 在Mac系统中安装VMsvga2:VMsvga2_v1.2.3 ...
- SQL SERVER 中identity用法
在数据库中, 常用的一个流水编号通常会使用 identity 栏位来进行设置, 这种编号的好处是一定不会重覆, 而且一定是唯一的, 这对table中的唯一值特性很重要, 通常用来做客户编号, 订单编号 ...
- BUG: GetDC() ReleaseDC()引起的内存泄漏
调用CWnd::GetDC函数跟CWnd::ReleaseDC函数的代码运行时,会出现 4 个字节的内存泄漏. Microsoft 已经确认这是在本文开头部分列出的 Microsoft 产品中的缺陷. ...
- 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 ...