A very rough and simple memory profiling middleware