How do auto flush know when to flush?