在Linux中使用iprm删除共享内存失败

时间:2015-09-18 23:08:10

标签: php linux ipc shared-memory ipcs

我正在使用共享内存,我正在测试内存引用溢出。我的代码中有一些问题,我无法删除所有内存段 我这样想:

ipcs -m
ipcrm -m 360448
ipcs -m

内存段永远不会删除

    ------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 360448     root       700        2484       2          dest
0x00000000 393218     root       700        8372       2          dest
0x00000000 425987     root       700        4416       2          dest
0x00000000 458756     root       700        2484       2          dest
0x00000000 491525     root       700        2400       2          dest
0x00000000 524294     root       700        12800      2          dest
0x00000000 557063     root       700        5800       2          dest
0x00000000 589832     root       700        144160     2          dest
0x00000000 622601     root       700        24672      2          dest
0x00000000 655370     root       700        34368      2          dest
0x00000000 688139     root       700        9996       2          dest

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。 当共享内存状态为dest时 首先使用ipcs -mp列出所有内存段 然后使用kill" lpid number"

删除内存段