I would like calculate the memory usage for single process. So after a little bit of research I came across over smaps and statm.
First of all what is smaps and statm? W
I would suggest looking through 'top' command line source code. It gets all its info from /proc as well so jt may be a good reference.