|
From: Betty W. <gre...@ho...> - 2004-09-16 16:14:12
|
Hi, Dimitri,
Thanks for your reply. What I want to measure using Valgrind is that
how much (computation) data is allocated in memory by the application. There
is no read/written into/from FILES involved in my case.
For example,
A simple matrix multiplication,
double matrixA[SIZE][SIZE], matrixB[SIZE][SIZE], matrixC[SIZE][SIZE];
for ( i = 0; i < SIZE; i ++)
for ( j = 0; j < SIZE; j ++)
for ( k = 0; k < SIZE; k ++)
matrixC[i][j] += matrixA[i][k] * matrixB[k][j]
The (computation) data allocated in memory is the size of
(matrixA + matrixB + matrixC).
i.e., 3 x (SIZE x SIZE) x sizeof(double). The size of the computation data
that need to used by this application, matrix multiplication is what I want
to know by using valgrind.
Of cause, matrix multiplication is a simple example. We can caculate
manually by knowing how much data needs to be allocated in memory. But for
more complex applications, it would be handy by using some tools, such as
valgrind to know how much data is allocated in memory.
So my question is if I have an application, would Valgrind tell me how much
data is used/accessed/allocated by this application?
I hope I made myself clear. If not, please let me know.
And thanks again for your kind help.
Betty
>-------- Original Message --------
>Subject: Re: [Valgrind-users] how to use valgrind to check data size?
>Date: Thu, 16 Sep 2004 10:00:09 +0200
>From: Dimitri Papadopoulos-Orfanos <pap...@sh...>
>To: val...@li...
>References: <414...@wm...>
>
>Hi,
>
>>I am new to valgrind. I have a question regarding to use valgrind to
>>check data size. Suppose I have an application, would it be possible to
>>use valgrind to check how much data this application is accessed? If so,
>>how would I do this?
>
>What do you mean exactly by "how much data"?
>
>How much data is read/written to/from files?
>How much memory is allocated?
>
>Dimitri
>
>
_________________________________________________________________
Dont just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
|
|
From: Shinni <pcs...@ni...> - 2005-03-18 16:57:34
|
Hi, I have a doubt similar to Dimitri's qn. 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 ? Thank you for your time Regards shinni |
|
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 |