Joe Damato has a great albeit infrequently updated programming blog, http://timetobleed.com/ . I think he wrote the memprof ruby gem. Posts HN may really enjoy:
an obscure kernel feature to get more info about dying processes [1]
a presentation from some ruby conf, particularly slide set 2 which details how memprof works and talks about the abi, etc [2]
plus a bunch of discussion of profiling tools to look at exactly what gcc or your vm of choice are doing. Highly recommended.