Implement Memory usage control for the threadpool.