Is it a bug (about share memory)?

From: Zheng, Jeff
Date: Fri Aug 22 2003 - 03:57:06 EST


Hi,

I tried to use share memory to check vm overcommit by check Committed_AS in /proc/meminfo. It seems that attach of share momory will add the value of Committed_AS but detach of share memory does not reduce the value of Committed_AS. Below is the result (attached file is source of the command)
[root@hpi overcommit_basic]# ./shm 5000000 m
The value of Committed_AS is 100436 KB before attach
The value of Committed_AS is 105384 KB After attach
[root@hpi overcommit_basic]# ./shm 5000000 m
The value of Committed_AS is 105520 KB before attach
The value of Committed_AS is 105520 KB After attach
[root@hpi overcommit_basic]# ./shm 5000000 n
The value of Committed_AS is 105416 KB before attach
The value of Committed_AS is 110364 KB After attach

the first parm is size of share memory, the second parm is proj of API ftok. When I allocate 5M, Committed_AS add 5M. The issue is: when I detach the share memory, and there is no other process attach to the share memory, Committed_AS does not reduce 5M.

Inactive of /proc/meminfo also changed.

My kernel is 2.5.70. And it seems that all kernel is the same.


Thanks
Jeff Jeff.Zheng@xxxxxxxxx
BTW, I speak for myself, not for Intel Corp.

Attachment: shm.c
Description: shm.c