The shared memory reported by statm is not what you think it is. See fork doesn't handle copy-on-write correctly and in particular Rik van Riel's reply:
The shared pages statistic is reported so low because they are measured differently, not because any deficiency in COW. COW still works fine.
Older kernels used to walk all the page table entries to count how many of the pages were shared with other processes.
This was too inefficient. Think of a server with a thousand Oracle processes, each having 2.7GB of virtual memory. Every screen update in top(1) would end up scanning the ptes for 2.7TB of memory!
Because of this, the newer kernels no longer look at page table entries. Instead, they count entire MAP_SHARED VMAs as shared memory. They no longer count the still shared COW pages in anonymous memory, since it is way too inefficient to count those.
In reply to Re: shared pages between parent and child
by almut
in thread shared pages between parent and child
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |