|
From: Milian W. <ma...@mi...> - 2014-05-14 10:03:22
|
On Tuesday 13 May 2014 19:13:23 Eliot Moss wrote: > On 5/13/2014 6:49 PM, Rob Taylor wrote: > > I recently discovered valgrind while searching for a way to see how much > > memory (total memory footprint) my small program represented. > > > > I was perplexed by the results I was seeing, since I expected at most to > > use perhaps tens of thousands of bites not Millions. My application is > > not dynamically requesting/allocating memory, all memory consumed is in > > the form of statically assigned character arrays, automatic stack usage > > etc.. > > > > So I did a test by running valgrind against an empty C program. The > > program does nothing but return. Can someone explain why the output shows > > continually increasing memory used and in total over a 6 MB peak? > > Dynamically linked libraries and their data. Some of that > (most of the code areas) can be shared in real memory with > other programs using the same library. There's a lot of > mechanism there, even if you are not using much of it, and > even if you are using parts of it without realizing it ... Yep, you are investigating on the page level, which is different from what you allocate. Remove that argument, but try --stacks=yes instead. Bye -- Milian Wolff ma...@mi... http://milianw.de |