|
From: Betty W. <gre...@ho...> - 2004-09-16 17:37:00
|
I want to follow up with the last message. To be more specific, Valgrind can check dynamic memory allocation by following the memory allocation and deallocation functions like, malloc, free, new, delete... But what about static memory allocation? Such as the example that I listed below, just declaring an array statically? is the the size of memory allocated statically can also be reported by Valgrind? Thanks! Betty >Betty Wang wrote: >>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/ >> >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 >>Project Admins to receive an Apple iPod Mini FREE for your judgement on >>who ports your project to Linux PPC the best. Sponsored by IBM. >>Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php >>_______________________________________________ >>Valgrind-users mailing list >>Val...@li... >>https://lists.sourceforge.net/lists/listinfo/valgrind-users _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ |