Linux 释放内存方法
Linux 释放内存方法
先看看内存使用状况
[root@node1 ~]# free -m
total used free shared buffers cached
Mem: 8004 6557 1446 0 163 5630
-/+ buffers/cache: 763 7240
Swap: 1983 0 1983
把内存里的数据暂时写到硬盘里
[root@node1 ~]# sync
修改 /proc/sys/vm/drop_caches文件
[root@node1 ~]# echo 3 > /proc/sys/vm/drop_caches
[root@node1 ~]# cat /proc/sys/vm/drop_caches
再看内存
[root@node1 ~]# free -m
total used free shared buffers cached
Mem: 8004 631 7372 0 0 60
-/+ buffers/cache: 570 7433
Swap: 1983 0 1983
相关文档:
一:前言
最近在研究android的sensor driver,主要是E-compass,其中用到了Linux input子系统.在网上也看了很多这方面的资料,感觉还是这篇分析的比较细致透彻,因此转载一下以便自己学习,同时和大家分享!
(这篇博客主要是以键盘驱动为例的,不过讲解的是Linux Input Subsystem,可以仔细的研究一下!)
键盘驱动将检 ......
Linux下网卡命名规律:eth0,eth1。第一块以太网卡,第二块。lo为环回接口,它的IP地址固定为127.0.0.1,掩码8位。它代表你的机器本身。
1、ifconfig是查看网卡的信息。
ifconfig [Interface]
Interface是可选项,如果不加此项,则显示系统中所有网卡的信息。如果添加此选项则显示所指定的网卡信息
&nbs ......
linux下file descriptoer限制
默认分类 2009-11-21 14:47 阅读0 评论0
字号: 大大 中中 小小
Tuning file descriptor limits on Linux
Linux limits the number of file descriptors that any one process may open; the default limits are 1024 p ......
gcc mousekey.c -lX11 -IX11
打开mousekeys运行./a.out
关闭mousekeys运行./a.out 1,这里在a.out后面随便加一个参数就可以了,因为判断条件为 if(argc < 2)
/*********source code***************/
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X ......