Use ring buffer
Merge pull request #1 from duego/6961-ring_buffer

Use ring buffer