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 ...
随机推荐
- C++ CheckMenuItem
菜单单选 关键点 CMenu::GetMenuState UINT GetMenuState( UINT nID, UINT nFlags ) const; MF_CHECKED MF_DISABLE ...
- android数据库操作之直接读取db文件
在对数据库操作时,常用的有两种方法: 1.在代码中建库.建表: 2.直接将相关库.表建立好,将db文件拷贝至assets目录下: 现在来看看第二种方法: private String Ge ...
- CODE:BLOCK中的CreateProcess: No such file or directory
现象: WINDOWS安装MINGW4.8.1,环境变量设置后,命令行窗体G++能够执行.但编译文件时提示: CreateProcess: No such file or directory. 安装C ...
- Key Task
Problem Description The Czech Technical University is rather old - you already know that it celebrat ...
- 解决easyui-datagrid在ie中无法reload问题
easyui在页面载入时,会自己主动填充datagrid中的数据,当加入.改动.删除后,会触发reload事件,对datagrid进行又一次载入. 这个过程在FireFox中没有问题,用firebug ...
- VirtualBox命令更改虚拟硬盘空间
主要是使用VBoxManage命令来操作 第一步:打开CMD,进入到virtualbox存放虚拟机的目录中(win7 系统可以直接在文件夹空白处按住shift键右键鼠标选择[在此处打开命令窗口]),输 ...
- 微信朋友圈分享页面(JS-SDK 1.0)
微信更新sdk后大量分享朋友圈代码失效,标题 缩略图 描述无法自定义 新版SDK分享文章步骤 1.绑定域名 (方法参考 http://mp.weixin.qq.com/wiki/7/aaa137b55 ...
- 1085. Perfect Sequence (25)
the problem is from PAT,which website is http://pat.zju.edu.cn/contests/pat-a-practise/1085 At first ...
- android 注册、登录实现程序
注册页面: user_register.xml: <?xml version="1.0" encoding="utf-8"?> <Linear ...
- c语言中的unsigned 和 signed
我们来一起看下,C语言中,对于Integer Type(整数形式)的unsigned与signed两种形式的区别,以及在内存中的存储方式是如何的 Integer type(整数形式)是C语言中的基本数 ...