in reply to Memory Profiling

take a look at Memchmark.

It can measure memory comsumption for diferent algorithms, though it only gives you aproximate meassures