Fix zpool history unbounded memory usage
zfs - Zettabyte File System
Port the following commit from OpenZFS
7125a109dcc Fix zpool history unbounded memory usage
From that description
In original implementation, zpool history will read the whole history before printing anything, causing memory usage goes unbounded. We fix this by breaking it into read-print iterations.