how to read size of process memory programatically?

douglaskbell's Avatar, Join Date: Feb 2010
Newbie Member
I'm tracking a memory leak in a C/C++ program on Solaris.

Is the a function to let a process programatically get its present size of memory usage?
(Like, what gets displayed for 'size' when you run 'top'.)
en_7123's Avatar, Join Date: Feb 2010
Ambitious contributor
Quote:
Originally Posted by douglaskbell View Post
I'm tracking a memory leak in a C/C++ program on Solaris.

Is the a function to let a process programatically get its present size of memory usage?
(Like, what gets displayed for 'size' when you run 'top'.)
Yes it is not difficult if I'm understanding it right what you are asking.Could you tell what exactly you want to do.And what is run top ??