This question is covered here in great detail.
How do you measure the memory usage of an application or process in Linux?
From the blog articl
There isn't any easy way to calculate this. But some people have tried to get some good answers: