[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory leak in wait

From: Jean Delvare
Subject: Re: Memory leak in wait
Date: Fri, 06 Mar 2015 11:08:37 +0100

Hi Chet,

Le Thursday 05 March 2015 à 11:11 -0500, Chet Ramey a écrit :
> On 2/28/15 5:29 AM, Jean Delvare wrote:
> > On Fri, 07 Nov 2014 08:24:07 -0500, Chet Ramey wrote:
> >> On 11/7/14, 3:49 AM, Jean Delvare wrote:
> >>> 2* If bash remembers the process statuses, how does one access the
> >>>    information? I couldn't find anything related to that in the manual
> >>>    page, but it's huge so maybe I missed it.
> >>
> >> You can use wait with a pid argument, maybe one that you saved earlier
> >> in a script or obtained from `ps'.
> > 
> > My question is, what is the point of keeping the information after wait
> > has been called for that PID? If this is the only possible use of the
> > information, I do not understand why the record is not discarded after
> > calling "wait $pid".
> Because the shell has always allowed a script to wait for a process
> multiple times.

Oh well, OK. That doesn't seem to be terribly useful, but thanks for the

> The shell discards all saved statuses when `wait' is called without
> arguments.

Yes, I'm going to use that for now. The long-term goal would be to use
the loadable builtin sleep implementation, to avoid running sleep in the
background altogether, but some integration work seems to be needed
first. More on that later.

And for the record, the excessive memory consumption that was reported
by a user of this script of mine does _not_ seem to be caused by the
process status being recorded. While I could reproduce and monitor the
bound memory increase caused by background process statuses being
recorded (490 kB max on my system), I could never get my script to reach
the 25 MB of total memory usage reported by the user. So the problem is
something else and still unidentified.

Thanks again,
Jean Delvare
SUSE L3 Support

reply via email to

[Prev in Thread] Current Thread [Next in Thread]