Added release memory and started end_memory