I have a daemon written in C running under a RHEL 4 machine.
The daemon access a segment of shared memory (nothing more than a big array of 65536 elements). No malloc/free are done.
I observed that ps aux shows that the daemon has the size of shared memory + some kb as VSZ and just some kb as RSS.
Then, the more the daemon access shared memory array, the more RSS increase until reaching circa the same size of VSZ.
Why Linux calculate the RSS in this way?
I mean... shared memory shouldn't be ignored as memory consumpted (RSS) by a single process, because it can be accessed by many others runnables?
And why it raise the RSS just accessing shared memory?