Implement garbage collection of higher order tasks.