|
From: Eliot M. <mo...@cs...> - 2014-05-13 23:30:19
|
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 ... Regards -- Eliot Moss |