I tried to find how to check for locked shared memory, i.e. using shmctl(SHM_LOCK), and I found that we can check it in code by setting the shmid_ds.shmperm.mode flag.
Now, similarly mlock(), we can check how much memory is being used by checking the value of /proc/<PID>/statusand VmLck.
I would like to know if there is a way to check how much shared memory is being used by a process that has been locked with shmctl(SHM_LOCK)?
I tried to use a function mlockand it shows how much memory is used, but it shows 0kb if I use shmctl(SHM_LOCK).
Just to add, I would like to see locked memory in the shell or through code (doesn't matter). I just need value.
I tried to browse the forum, but could not find the answer to this question. Any help is appreciated.
source
share