Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: sluggish prompt



On Oct 7,  9:46pm, Russell Hoover wrote:
}
} On Sun 10/07/07 at 10:02 AM -0700,
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} 
} > [...]  Have you looked at the output of "ps" [...]
} > to see how much memory your shell is consuming?
} 
} [panix1:~]  [v4.3.4]  zsh  1003 --> ps up$$
} USER   PID %CPU %MEM VSZ  RSS TTY   STAT STARTED    TIME COMMAND
} rj   18666  0.1  0.2 800 2608 ttyr0 Ss    6:25PM 0:00.81 zsh-4.3.4
} 
} Is "0.2" percent of memory usage normal?  Not sure how to guage that.

The absolute memory use is the RSS column: 2608 KB.  That's about the
same as my RSS here, on a workstation where I'm the only user.  On the
other hand, my VSZ (virtual memory size) is 6636 KB compared to your
800 KB, so I don't think you're doing anything unusual.

} I log into one of 4 or 5 user hosts.  I don't think there's anything
} about the busyness of panix that would cause the promt-delay.

Well, if you're one of more than 500 users and each of you is consuming
0.2% of the system memory, then *somebody* is going to have to get
swapped out -- and that doesn't even consider all the memory that is
being occupied by other programs that all those users are running.
The longer a process is idle, the more completely it gets swapped out,
and the longer it takes to come back.  When you say:

} Of course, if I'm at the prompt and I hit <RETURN> several times,
} there's no delay. If I haven't been to that window, that shell, for
} awhile, and the prompt has been there, and I go back to that window
} after awhile and hit <RETURN>, there's a delay.

That sounds *exactly* like an idle process being swapped out and then
taking a short while to swap back in again when it is no longer idle.

A shell that's been waiting for an external command to exit is similarly
idle and thus also a candidate for swapping.

(However, one symptom does not a diagnosis make.)

} > If only at startup, then it's not something to worry about.
} 
} It's definitely not just at startup.

Wrong context.  I meant "If, when you have set -x in your .zshrc, and
you see the list of files in your fpath being printed by the nested
for-loops, that output does not appear every time, then it's not
something to worry about."  I was not talking about the 6-10 second
delay when I said "only at startup" in that sentence.

} I put the print line in .zshrc, closed vim.  Back at the prompt I did
} 
} 	exec zsh -l
} 
} Then I waited 8 seconds.  Then the "PRECMD" appeared, and the prompt
} immediately appeared on the next line.

OK, but that's not all that interesting.  What we need to know is, on
every *subsquent* prompt, as you go through your normal habitual use
of zsh on this system, do you see delays before PRECMD is printed or
in between PRECMD and the prompt?

} I use 3 startup files.  Here are the other 2.   zprofile first, then the
} .zshenv.  Thanks again.

Nothing exciting there ... but I went back and looked at your .zshrc
file again and noticed this:

export MAIL=$HOME/.maildir/
export MAILCHECK=10

Do you have a lot of mail?  Is it on an NFS filesystem that might be
slow to respond?  If you set MAILCHECK to a much larger value, does
the delay become less frequent?



Messages sorted by: Reverse Date, Date, Thread, Author