After three years working on a C++ project, the executable has grown to 4 MB. I\'d like to see where all this space is going. Is there a tool that could report what the biggest
Get a link map, or use dumpbin
to get a list of symbols and sizes.
Chances are there's a lot of stuff being pulled in that you don't strictly need.
ADDED: Did you get a satisfactory answer? I realized there are two ways people approach problems like this:
Personally I prefer the latter - it gets results quicker.
You say the app is 4MB. Suppose the true necessary size is 1MB (or some such size). That means if you pick a routine at random from the map file, it is 75% likely to be something you don't need. Find out what's causing it to be included, and see if you really need it.
In the example you gave, you saw a class that wraps device-independent-bitmaps. You could find instances of that class in your app, and possibly replace them with basic WIN32 bitmaps. It would be less pretty, but save gobs of app size.
Then keep on doing it. Each large piece you get rid of makes the remaining pieces take a larger percentage of the app, because the app has shrunk but the pieces haven't. That makes them easier to find in the map file.