<<< Date Index >>>     <<< Thread Index >>>

Re: Mutt eat all system resources if "color" is used...



On 12Jul2008 14:21, Michelle Konzack <linux4michelle@xxxxxxxxxxxxxxx> wrote:
| I am working with an IBM ThinkPad 570  (P2/366MHz/192MB)  and  it  works
| perfectly but for some days I have setup some new colorization  and  now
| mutt kill all of my CPU and Memory resources...
| 
| ----[ '~/.mutt/colors' ]------------------------------------------------
| color body brightmagenta        default "^\-\-\-\-\\[ STDIN \\]\-\-.*"

1: Why are all the dashes ('-') backslashed?
2: You do not need the trailing '.*' on all these patterns.

| color body brightmagenta        default "^\\+\-\-\-\\[ STDIN \\]\-\-.*"
| color body brightmagenta        default "^\-\-\-\-\\[ manpage \'.*\' 
\\]\-\-.*"

The inner '.*' here may be raising the cost to evaluate this pattern.
See if [^\]*] works better than .*.

| color body brightmagenta        default "^\\+\-\-\-\\[ manpage \'.*\' 
\\]\-\-.*"
| color body brightmagenta        default "^\-\-\-\-\\[ command \'.*\' 
\\]\-\-.*"
| color body brightmagenta        default "^\\+\-\-\-\\[ command \'.*\' 
\\]\-\-.*"
| color body brightmagenta        default '^| '

You probably want to backslash the '|' here - it is a regexp punctuation
character.
[...snip...]

| OK, I have arround 150  mailfolder  defined  in  "mailboxes"  and  after
| checkig the 15th, mutt has eaten then whle memory (192 MByte) and  begin
| to eat my SWAP (256 MByte).  Also if I press <PAGEDOWN> in  the  message
| view, the CPU utilization jumps for 4-7 seconds to 100%
| 
| Can anyone tell me why?

I can't speculate about the memory usage.
But it is easy to write regular expressions that are very expensive.

I would do the following:

1: Get rid of the backslashes on the '-' characters.
   The just make everything hard to read.
   Test that the patterns still work.

2: Get rid of the trailing '.*' on each pattern.
   It is not needed and just makes extra work.
   (Urr, unless mutt colours only the matched part of the line.
   I have not checked that. But it is still a useful experiment.)
   Test that the patterns still work.
   And if so, see if the performance issues are improved.

3: Comment out the patterns with '.*' in the middle.
   See if the performance problems are affected.
   I would expect that you could comment out all the patterns
   in your snippet and add them back one at a time.
   This should tell you that a particular pattern is expensive,
   and presumably the others like it.

What results do you get?
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/