Isn't summing RSS going to end up with the wrong numbers?
My understanding is that RSS is memory allocated (heap + stack) + executable pages inclusive of shared libraries.
i.e, if 10 processes load libfoobar which is 10MB of code, each processes RSS value will be 10MB higher. So if you sum RSS you see 10 x 10MB or 100MB extra usage. But the pages for that library will be shared across processes, with the result that "real ram usage" only goes up by 10MB.
Please correct me if I'm wrong. This is based on my understanding of Linux too. FreeBSD might be different.
My understanding is that RSS is memory allocated (heap + stack) + executable pages inclusive of shared libraries.
i.e, if 10 processes load libfoobar which is 10MB of code, each processes RSS value will be 10MB higher. So if you sum RSS you see 10 x 10MB or 100MB extra usage. But the pages for that library will be shared across processes, with the result that "real ram usage" only goes up by 10MB.
Please correct me if I'm wrong. This is based on my understanding of Linux too. FreeBSD might be different.