when viewing a large file (269MB xml file) with less, code2color eats up all memory. (1600 MB) Reproducible: Always Steps to Reproduce: 1. less file.xml 2. wait a few minutes 3. reboot computer 'cause it does not respond to user input (swapping all the time)
And could you explain why is this a Gentoo-specific issue? On that note, which less version(s) is this about?
(In reply to comment #1) > And could you explain why is this a Gentoo-specific issue? There is no code2color in the official less. I think this is an gentoo-specific "improvement". > On that note, which less version(s) is this about? Version 394
(In reply to comment #2) Oh sorry, its Version 406 ... my esearch database is not up to date.
This affects most syntax-coloured files. E.g. opening a 185k C source file eats up ~45 seconds of P4 CPU before displaying *anything*, making it unusable.
less colorization is now turned off by default
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=023b7de83186fbb6e97ea09ded7c6bfdadd4f1da commit 023b7de83186fbb6e97ea09ded7c6bfdadd4f1da Author: Alan Swanson <reiver@improbability.net> AuthorDate: 2023-06-23 13:26:06 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-06-23 21:57:31 +0000 sys-apps/less: reenable colourisation by default using pygmentize Previously disabled due to old bug #188835 where code2color consumed excess memory compared to source file being colourised. Update LESSCOLORIZER to use pygmentize instead if available. This is installed with dev-python/pygments which is a common dependency. Program code2color can still be installed with app-text/lesspipe. Bug: https://bugs.gentoo.org/188835 Signed-off-by: Alan Swanson <reiver@improbability.net> Closes: https://github.com/gentoo/gentoo/pull/31584 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/less/files/lesspipe-r2.sh | 291 +++++++++++++++++++++++++++++++++++++ sys-apps/less/less-633-r1.ebuild | 80 ++++++++++ sys-apps/less/less-9999.ebuild | 8 +- 3 files changed, 375 insertions(+), 4 deletions(-)