Implemented a buffer pool to avoid allocating memory all the time while recording.