Does anybody know how to find out how much memory a program uses during execution? Is there some kind of debugger/profiler which does this? Since I use dynamic memory allocation a lot, it would be interesting to know which arrays are allocated currently and their size.
Most people simply use ‘top’ to determine how much total memory a program is using. For more advance memory profiling, you should take a look at Valgrind (www.valgrind.org), specifically the Massif heap profiler. I have not used Massif myself, and don’t know if it will give you the details your looking for, but it is worth investigating.