Can anyone suggest a tool for optimization for me?
I am writing in C on linux, and during our calculation we get a out of memory error. We have some ideas as to what structures are taking up a lot of memory but I need a way to make sure. I know there are tools that tell you what functions are called and how many times, but are there tools that will tell you what part of your program is taking up a lot of memory?
For example if I have a large voxel calc grid, and I am unsure of how many are used, the tool would be able to tell me that so much memory is taken up by each one and there are x number of them.
Posted Dec 19, 2012, 3:17 PM UTC
52
valgrind
Yep, valgrind is the ultimate power tool for this type of thing.
In particular, note that valgrind is a collection of tools: the one you want is probably "massif". It's as simple as this to get started:
Tip: compile in debug mode (the -g option, and without any -O optimization) while debugging.