added periodic garbage_collect call