Calculating private and shared memory for processes