Method to measure the amount of allocated memory of a program at run-time.