Make `try_to_free_memory` static