new algorithm for stack cache garbage collection