release heap memory