IPCS Shared Memory Segments

Combiner for parsing shared memory segments gotten from command ipcs. It uses the results of the IpcsM and IpcsMP parsers to get the size of the shared memory of special PID.

class insights.combiners.ipcs_shared_memory.IpcsSharedMemory(shm, shmp)[source]

Bases: LegacyItemAccess

Class for parsing shared memory segments outputted by commands ipcs -m and ipcs -m -p.

Typical output of command ipcs -m is:

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x0052e2c1 0          postgres   600        37879808   26
0x0052e2c2 1          postgres   600        41222144   24

Typical output of command ipcs -m -p is:

------ Shared Memory Creator/Last-op --------
shmid      owner      cpid       lpid
0          postgres   1833       23566
1          postgres   1105       9882

Examples

>>> type(ism)
<class 'insights.combiners.ipcs_shared_memory.IpcsSharedMemory'>
>>> ism.get_shm_size_of_pid('1105')
41222144
get_shm_size_of_pid(pid)[source]

Return the shared memory size of specified pid.

Returns

size of the shared memory, 0 by default.

Return type

(int)