Added memory tracking into framework