ipcs和ipcrm管理共享内存 系统共享内存配置
- 2015-07-25 10:13:00
- admin
- 原创 2268
一、ipcs显示共享内存
ipcs - provide information on ipc facilities
-m shared memory segments
-q message queues
-s semaphore arrays
-a all (this is the default)
显示共享内存:ipcs -m
二、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.
删除共享内存:ipcrm -m shmid
三、系统共享内存配置
1、shmmax,单块共享内存最大值;
2、shmmin,单块共享内存最小值;
3、shmseg,单个进程最多可以使用多少块共享内存;
4、shmmni,所有进程最多可以使用多少块共享内存;
5、shmall,系统总共可以分配多少共享内存,以页为单位;
6、通过文件查看共享内存参数/proc/sys/kernel/varname;
发表评论