most icon indicating copy to clipboard operation
most copied to clipboard

pipe-most can eat all memory (there is no limit on internal buffer size)

Open Roslaniec opened this issue 1 year ago • 0 comments

When using most over pipe, it will store all pipe output in internal buffer, increasing buffer size limitlessly. Eventually, most will consume all available memory.

To reproduce run: perl -e 'for (my $i=0; ; $i++) { print($i.("."x100)."\n"); }' |most Search for some string (eg. "/555555") and press "nnnnnnnn"....

Solution: There should be some limit on internal buffer size. Preferably it should be configurable (e.g. less program has -b option). Alternatively, reasonable fixed-size buffer (like few mega bytes) would be still better than eating all memory.

Roslaniec avatar Sep 10 '23 17:09 Roslaniec