Free memory when the last pool has been drained.