title: Linux RSS and Shared Memory
body: <p>I have a daemon written in C running under a RHEL 4 machine.</p>
  
  <p>The daemon access a segment of shared memory (nothing more than a big array of 65536 elements). No malloc/free are done.</p>
  
  <p>I observed that <em>ps aux</em> shows that the daemon has the size of shared memory + some kb as VSZ and just some kb as RSS.</p>
  
  <p>Then, the more the daemon access shared memory array, the more RSS increase until reaching circa the same size of VSZ. </p>
  
  <p>Why Linux calculate the RSS in this way?</p>
  
  <p>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?</p>
  
  <p>And why it raise the RSS just accessing shared memory? </p>