ipcs php 释放,ipcs和ipcrm管理共享内存、消息队列、信号 /proc/sys/vm/drop_caches管理缓存...

一、ipcs命令(显示进程间通信信息)

ipcs - provide information on ipc facilities

-m     shared memory segments

-q     message queues

-s     semaphore arrays

-a     all (this is the default)

显示共享内存信息

[root@ebs-19233 ~]#ipcs -m

------ Shared Memory Segments --------

key        shmid      owner      perms      bytes      nattch     status

0x00000000 1638400    root       600        524288     16         dest

二、ipcrm命令(删除进程间通信信息)

ipcrm [ -M key | -m id | -Q key | -q id | -S key | -s id ] ...

-m shmid:removes the shared memory segment identified by shmid after the last detach is performed.

-q msgid:removes the message queue identified by msgid.

-s semid:removes the semaphore identified by semid.

[root@ebs-19233 ~]# ipcs -m

------ Shared Memory Segments --------

key        shmid      owner      perms      bytes      nattch     status

0x00000000 1638400    root       600        524288     16         dest

0x28a11375 1671169    root       644        1000       0

[root@ebs-19233 ~]# ipcrm -m 1671169

[root@ebs-19233 ~]# ipcs -m

------ Shared Memory Segments --------

key        shmid      owner      perms      bytes      nattch     status

0x00000000 1638400    root       600        524288     16         dest

三、/proc/sys/vm/drop_caches管理缓存

操作系统可用内存:free memory

应用进程可用内存:free memory+buffers+cached(buffers和cached可以被很快回收)

buffers:磁盘io写缓存

cached:频繁访问的文件缓存,如果值很大说明缓存的文件内容很多。

To free pagecache, use echo 1 > /proc/sys/vm/drop_caches;

To free dentries and inodes, use echo 2 > /proc/sys/vm/drop_caches;

to free pagecache, dentries and inodes, use echo 3 > /proc/sys/vm/drop_caches.

Because this is a non-destructive operation and dirty objects are not freeable, the user should run sync first.

#sync //同步到磁盘

#echo 3 >/proc/sys/vm/drop_caches //刷新缓存

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值