Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 188835 - sys-apps/less - code2color uses all memory
Summary: sys-apps/less - code2color uses all memory
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-14 13:56 UTC by Salgar Alvidason
Modified: 2024-02-27 19:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Salgar Alvidason 2007-08-14 13:56:16 UTC
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)
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-08-14 14:04:31 UTC
And could you explain why is this a Gentoo-specific issue? On that note, which less version(s) is this about?
Comment 2 Salgar Alvidason 2007-08-14 14:55:57 UTC
(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

Comment 3 Salgar Alvidason 2007-08-14 14:58:20 UTC
(In reply to comment #2)
Oh sorry, its Version 406 ... my esearch database is not up to date.

Comment 4 cmackin+gentoobugzilla 2007-08-23 21:17:25 UTC
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.
Comment 5 SpanKY gentoo-dev 2007-08-25 15:42:24 UTC
less colorization is now turned off by default
Comment 6 Larry the Git Cow gentoo-dev 2023-06-23 21:59:19 UTC
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(-)