But the value in max_running_memory_size is only updated once, after looping over all the nodes of the function. So, at that point, running_memory_size is the size of whatever memory is currently used, with "currently" being "the end of the execution".