Fix potential memory issue for applications with high throughput.