Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle shared memory View ipcs Command details

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Ipcs-provide information on ipc facilities

DESCRIPTION

Ipcs provides information on the ipc facilities for which the calling process has read access.

The-i option allows a specific resource id to be specified. Only information on this id will be printed.

Resources may be specified as follows:

-m shared memory segments

-q message queues

-s semaphore arrays

-an all (this is the default)

The output format may be specified as follows:

-t time

-p pid

Note:

The information listed in the key column is the key value defined by the application. If it is a private object, the key value is 0. Here we define the key value as 12345678, which is the output 0x00bc614e (hexadecimal).

The ID of shared memory is listed in the shmid column, which is unique.

The owner column lists that the user who created the shared memory is root.

The permissions for shared memory are listed in the perms column.

The size of this shared memory is listed in the bytes column, and we get 4096 bytes of shared memory to be created by calling sysconf (_ SC_PAGE_SIZE).

The nattch column lists the number of processes connected to the associated shared memory segment.

The status of the current shared memory is listed in the status column, and the word "dest" is displayed when the SHM_DEST bit is set in the mode field of that memory.

When a user calls shmctl's IPC_RMID, the kernel first looks at how many processes are still associated with this memory. If the association number is 0, the memory will be destroyed (released), otherwise the mode bit SHM _ DEST of this memory will be set.

And set its key to IPC_PRIVATE, which means that the associated process can still legally access the memory, but it can no longer be associated with a new process.

In the above output, we do not see the status of dest in the shared memory used by smem, and when we manually delete the shared memory with ipcrm-m 18874397

At this time, the shared memory key value of the segment will be 0x00000000 (IPC_PRIVATE), and the shared memory will really disappear when the program calls shmdt to free the shared memory.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report