Use ring buffer.