In C++ what are best practices for garbage collection? In C++ what are best practices for garbage collection? Solution The garbage collection in cpp is automatic but if you want to release resources yourself like closing files and release memory you can use : - destructor in case of objects which are destroyed or released from memory after its scope ends - delete operator to release other type of resources.