프로...Linux

[IPC] Inter-Process Communications

크크다스 2019. 3. 14. 22:02
반응형

[IPC] Inter-Process Communications

ipcs -m 으로 확인시 key가 0x0000 이고 ID는 정상적인 것을 볼 때가 있다.

- 여러 프로세스가 Running중에 공유메모리를 사용중인 상태에서 

. 해당 메모리를 삭제하면 해당 증상이 나타나며

. ipcrm으로 Key / Id 형식으로 삭제하려고 해도 삭제되지 않는다.

-> 나머지 프로세스가 종료되면 해당 메모리도 없어진다.


확인 방법>

ipcs

ipcs -m (Share Memory만)

ipcs -s (Semapho만)


status 중 "dest" 는 .... "marked to be destroyed on the system."


삭제 방법>

ipcrm -M shm_key

ipcrm -m shm_id


# ipcs -m
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status     

                                                                   ^           ^
                                                                   |           +-----[ Number of application being attached to the shared memory ]

                                                                   +-----------------[ Memory segment is marked to be destroyed ]

반응형