For example, say I have a class Temp:
class Temp { public: int function1(int foo) { return 1; } void function2(int bar) { foobar = bar; }
There's a utility call pahole (for 'Poke-A-HOLE') that's nominally intended to study how object layouts get padded, but is great for visualizing object size and layout in general.
pahole