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 ...
随机推荐
- JSON API in Javascript
1. Serialize JavaScript object to JSON var messageObject = { title: 'Hello World!', body: 'It\'s gr ...
- CDOJ 1251 谕神的密码 贪心
谕神的密码 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/1251 Descr ...
- Codeforces Bubble Cup 8 - Finals [Online Mirror]H. Bots 数学
H. Bots Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/575/problem/H Desc ...
- c#匿名类 anonymous学习
感谢http://blog.csdn.net/jjx0224/article/details/5887589 感谢http://hi.baidu.com/guodong828/blog/item/cc ...
- C# Func<>托付
曾经我们为了可以调用一个方法.必须比照这种方法定义一个对应的delegate. 原先我们定义delegate // 托付声明 -- 定义一个签名: delegate double MathAction ...
- 深度学习论文笔记-Deep Learning Face Representation from Predicting 10,000 Classes
来自:CVPR 2014 作者:Yi Sun ,Xiaogang Wang,Xiaoao Tang 题目:Deep Learning Face Representation from Predic ...
- currentTarget 与 Target 的区别
在一般情况下,target与currentTarget指向的是同一个对象.一般情况是指我们只对某一个独立的mc添加侦听器.如下: var mc:Sprite=new Sprite();addChild ...
- ROC和AUC介绍以及如何计算AUC
原文:http://alexkong.net/2013/06/introduction-to-auc-and-roc/ 为什么使用ROC曲线 既然已经这么多评价标准,为什么还要使用ROC和AUC呢?因 ...
- Redis 有序集合(sorted set)
Redis 有序集合和集合一样也是string类型元素的集合,且不允许重复的成员. 不同的是每个元素都会关联一个double类型的分数.redis正是通过分数来为集合中的成员进行从小到大的排序. 有序 ...
- Yar - Yet Another RPC framework for PHP
Introduction Yar is a RPC framework which aims to provide a simple and easy way to do communication ...