added memory_consumption function