LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1027|回复: 3

proc目录总的大小有多大?

[复制链接]
发表于 2008-11-5 03:10:42 | 显示全部楼层 |阅读模式
用du -sh怎么显示大小为0呢?
du -sh /proc/
du: cannot access `/proc/2219/task/2219/fd/4': No such file or directory
du: cannot access `/proc/2219/task/2219/fdinfo/4': No such file or directory
du: cannot access `/proc/2219/fd/4': No such file or directory
du: cannot access `/proc/2219/fdinfo/4': No such file or directory
0       /proc/

咋会这样呢?

我知道proc是一个虚拟的文件系统,在磁盘上它是不存在的,是内存中一块记录系统信息的区域,那也不能没有大小是吗?
du只能计算磁盘上的空间大小吗?
那么如何计算proc锁占用内存的大小呢?
发表于 2008-11-5 08:40:38 | 显示全部楼层
估计计算使用空间大小的函数不适用,你得看看它的驱动,看看有没有给他计算占用空间的函数,没有的话自己加去。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-11-7 01:14:01 | 显示全部楼层
Post by kilior;1904142
估计计算使用空间大小的函数不适用,你得看看它的驱动,看看有没有给他计算占用空间的函数,没有的话自己加去。

代码在哪里,能否指点下
回复 支持 反对

使用道具 举报

发表于 2008-11-13 10:34:57 | 显示全部楼层
xxxxx:/data/server # du -sh /proc/
du: cannot access `/proc/0': No such file or directory
du: `/proc/16831/task': No such file or directory
du: `/proc/16831/fd': No such file or directory
897M    /proc/
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表