Optimize memory footprint of line buffers