see -
http://collectl.sourceforge.net/
Among may other things it will report quite a lot about memory. Here's one example but it may look kind of crappy with wrapping but you should get the general idea:
# MEMORY STATISTICS
#<------------------------Physical Memory-----------------------><-----------Swap----------><-Inactive-><Pages/sec>
# TOTAL USED FREE BUFF CACHED SLAB MAPPED COMMIT TOTAL USED FREE TOTAL IN OUT
3943M 1070M 2872M 158552K 591012K 127500K 53108K 82172K 4361M 0 4361M 524496K 0 0
But it is also capable of reporting slab allocation breakdowns which gives a much more detailed view of memory. Look at /proc/slabinfo and then allow you to save timestamped samples to a file or look at them interactively and you'll have some idea of what collectl can do with that type of data.
Of course you also get cpu, disk, network and a whole lot of other types of data as well...
-mark