Currently the memory usage of the less command is set by a fixed number of lines. It should be possible to change this so that the buffer is set by the amount of memory used by the buffer.
Each record (line struct) has a value for the amount of raw bytes it took up, so this should be easy to calculate.