Cleaning of kernel resource management