-   Programming (
-   -   memory occupied by a program (

rajesh_b 11-13-2006 02:56 AM

memory occupied by a program
I want to find out total memory occupeid by a program at run time.
One problem is my program uses dynamic memory allocation at some points of code. Can any body please tell me how to find out actual memory taken by the program. ( I think i cant take the size of .out file)
Thanks in advance.


Samotnik 11-13-2006 08:53 AM

Did you tried ps -eF <processname>?

jinksys 11-15-2006 06:30 AM

You can't find out how much memory a program may use if it employs dynamic memory. The whole idea of dynamic memory is that it is not a predetermined amount. There is no way of guessing whether an app will open a 1kb file or a 1gb file.

95se 11-15-2006 10:07 AM

Check out the dmalloc library. It's very simple to use, and provides lots of good info about your dynamic memory usage.

All times are GMT -5. The time now is 12:49 PM.