Add a mechanism to run garbage collection periodically