where does my 4k shared memory go?

Tien Nguyen thanhtien501 at gmail.com
Tue Nov 29 02:18:16 EST 2016


As I read from
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/proc.txt?id=HEAD#l451
(line 906)

*the Shmem field in /proc/meminfo: Total memory used by shared memory
> (shmem) and tmpfs*
>
tmpfs size:

/proc # df -Thk |grep -E "tmpfs|Used"
Filesystem               Type     1K-blocks    Used Available Use% Mounted on
devtmpfs                 devtmpfs   1963344       8   1963336   1% /dev
tmpfs                    tmpfs      2027904     728   2027176   1% /dev/shm
tmpfs                    tmpfs      2027904    9936   2017968   1% /run
tmpfs                    tmpfs      2027904       0   2027904   0%
/sys/fs/cgroup

*total (tmpfs) size: 8+ 728 + 9936 = 10672 kB*

shared mem by ipc

/proc # ipcs -mu

------ Shared Memory Status --------
segments allocated 23
pages allocated 1855
pages resident  1855
pages swapped   0
Swap performance: 0 attempts     0 successes

/proc # getconf PAGESIZE
4096

-->ipcs shared mem = 1855 * 4096/1024 = 7420kB

*> 7420kB (ipcs mem) + 10672 (tmpfs) = 18092 Kb*

**

/proc # cat /proc/meminfo |grep ShmemShmem:  18096 kB

which is different from Shmem in meminfo 4Kb could you help me about "where
is 4Kb located?"

Thank you so much
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20161129/77e5eaff/attachment.html 


More information about the Kernelnewbies mailing list