本文为摘录,原文为: https://linuxopsys.com/topics/check-shared-memory-in-linux

1 RTFM…

1.1 ipcs

1.2 ipcrm

2 Check shared memory in Linux

Print active shared memory segments using -m option.

# ipcs -m
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 65536 root 600 393216 2 dest
0x00000000 98305 root 600 393216 2 dest

where,

“dest” status means memory segment is marked to be destroyed “nattach” field shows how many application pid’s are still attached to the shared memory

The following command print information about active shared memory segments: