|
From: Nicholas N. <nj...@cs...> - 2005-03-18 20:08:46
|
On Fri, 18 Mar 2005, Shinni wrote: > Can i use valgrind for profiling memory usage ? > > is there any option in memcheck tool to know how much memory/swap space a > process is used for its entire execution ? > ( Like $time -f "%k" process , to know a process's memory usage? time command > gives me no result in my system) > > When i run valgrind memcheck tool for my program , i get the folowing > malloc related output (as in everyone's case).. > > ==2665== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 15 from 1) > ==2665== malloc/free: in use at exit: 3738920 bytes in 79 blocks. > ==2665== malloc/free: 6826 allocs, 6747 frees, 7862936 bytes allocated. > ==2665== For a detailed leak analysis, rerun with: --leak-check=yes > ==2665== For counts of detected errors, rerun with: -v > > Here , does the third line mean that the program used malloc 6826 times and > during its execution time , 7862 KB is allocated ? Are there any guidelines to > interpret the output valgrind gives? ( I'm a newbie * :( * ) > > I wanted to use valgrind for perfomance analysis of my programs. Is the info i > get like above is sufficient for this ? or is there any other way ? You can use the tool "Massif" (use --tool=massif). It produces output that is similar to, but not exactly the same as, what you are asking for. N |