release heap memory correct