Shared Memory Pages

To facilitate data sharing, you can create shared memory pages. Multiple processes can read and write to and from a common shared memory area. The kernel maintains and administers the shared memory areas and allows individual processes access to the shared area.

The special ipcs command allows you to view the current shared memory pages on the system. Here’s the output from a sample ipcs command.

root@dell:~# ipcs -u

—— Shared Memory Status ——–
segments allocated 6
pages allocated 576
pages resident 528
pages swapped 0
Swap performance: 0 attempts 0 successes

—— Semaphore Status ——–
used arrays = 0
allocated semaphores = 0

—— Messages: Status ——–
allocated queues = 0
used headers = 0
used space = 0 bytes

Each shared memory segment has an owner that created the segment. Each segment also has a standard Linux permissions setting that sets the availability of the segment for other users. The key value is used to allow other users to gain access to the shared memory segment.

-m shared memory segments

root@dell:~# ipcs -m

—— Shared Memory Segments ——–
key shmid owner perms bytes nattch status
0×00000000 327680 buddy 600 393216 2 dest
0×00000000 360449 buddy 600 393216 2 dest
0×00000000 262146 buddy 600 393216 2 dest
0×00000000 294915 buddy 600 393216 2 dest
0×00000000 393220 buddy 600 393216 2 dest
0×00000000 425989 buddy 600 393216 2 dest

One Response to “Shared Memory Pages”

  1. 2replieson 13 Jan 2022 at 1:16 am

    3vanishing…

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.