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

zsh 3.0.7 hogs memory



We've run across an interesting problem where zsh 3.0.7 will grow in size,
consuming memory until the system paralyzes itself with swapping, then
suddenly break itself free.

Environment: zsh 3.0.7, Sun Enterprise 5000 with 2 Gig memory and 6
processors, Solaris 2.5.1.

It usually seems to happen to people running Pine (4.10).  My guess at
this point is that they dial in, start pine, and then either disconnect or
become disconnected.  This has often caused problems with programs that
try to handle exceptions and fail in some cases (I've seen this a lot
starting with SAS on Cyber mainframes in 1980).

I tried running a script that sleeps for 1 second then asks "how long have
I been sleeping?".  If the answer is over 2 seconds it does a
"ps -eo pmem,user,pcpu,rss,vsz,fname | sort | tail"
to a log file.  Some of the entries include:

  %MEM     USER %CPU  RSS  VSZ COMMAND
  12.3    hbear  3.1 252832 599944 zsh
  71.3  skuyper  8.1 1466520 1941360 zsh
  86.1    renee 13.2 1772384 1941352 zsh

86% of 2 Gig is 1.72 Gig, a ridiculous amount for a shell to consume, so
clearly there is a problem.

One other clue:  This only started happening when I added the following to
/etc/zshenv:

  export HISTSIZE=200
  export HISTFILE=~/.zsh_history
  export SAVEHIST=200

Once I commented it out, the problem went away.  SO, I'm suspicious of
problems in exception handling (disconnect) with history files turned on.
Of course I might be wrong about the exceptions issue.

Any suggestions/fixes?

Jim



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