How to find total memory usage of a program?
Hello, I wrote a program that multiplies 2 matrices using multi-threads and another one using multiple processes and shared memory. Both in C.
I need to find the total memory usage of these programs. I know of the top command, but when my matrices are relatively small they don't even show up on top because they complete so fast, how can I find the memory usage for these instances? Also, how can I find the total turnaround time of my programs? Any help would be appreciated, thanks in advance. |
Have a look at valgrind .. may be sufficient.
|
Thanks a lot! That had just what I was looking for.
|
You can use pmap or:
Code:
ps -eo size,pid,user,cmd | grep <process_name> | grep -v grep | awk '{ m+=$1 } END { print m }' |
All times are GMT -5. The time now is 03:54 PM. |