Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: chen liu Newsgroups: gnu.bash.bug Subject: Re: Memory continusely increase Date: Wed, 26 Dec 2018 19:01:23 +0800 Lines: 77 Approved: bug-bash@gnu.org Message-ID: References: <1545199834453-0.post@n7.nabble.com> <8ba9e82f-020a-3bf5-87c5-ce250f89e269@case.edu> <20181226053501.GA31843@debian.vc.shawcable.net> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1545822465 32750 208.118.235.17 (26 Dec 2018 11:07:45 GMT) X-Complaints-To: action@cs.stanford.edu To: chen liu , chet.ramey@case.edu, bug-bash Envelope-to: Bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=0U9jOpsPwqPx+vJfsvGNQ8t6NzyWLljCbBCW42QIlsU=; b=oEcUi9Rcsf+pVN2XLZhGF2TjNd7qQNWITjbJEp4RB0+Gi+jRiOkU5fECQdje+qJPwS 3fAixKeHL2XllngHqPLCTLajDC71G9r1pEl6/14pRfvwMv0v1Zf2vGdRXHjVIrzb+bvC n/Y9hvsiU9j6bVTVD3fX1RSvi6IIA57Ebv6Nh0DLV6DL3pCbBAtGB4iKW0aoHJRlCdDD 6XT6rzJLeXLBsbVRs0ZditENqdcgf4uX6xHvSI8VBSDM9gErK752KF74Ehb1oo+vRUru aYdNd7FmGbKmIAdusyVFtdH6/CUaK52qYlCYhlgd1xZ3ukVGr7sC5pwO8t6ZqnRHEReO Aqlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=0U9jOpsPwqPx+vJfsvGNQ8t6NzyWLljCbBCW42QIlsU=; b=M7T0Njrhiq9ICPMAn+MIdH8mfa97n+OUZfZkZYt0iMSrSuqxVEJuMouUqcNy3mIswO s68RFGel0tofthZXaUkgP8CvFpn0Q4LvNTH9ug9KLwulZh5Ifk7esNUn+7xOspOBMyMK 1N9/11qN82E9yVmwWbspZMKUvrqIcnvxyVVSXE7y8STMPuqftLVRHMuI7u7G/K8iyEpV he2aC57RG6y4rIzUPFQUf6bKRGh3ix0O7MpYJ5gGqi9Dzyh5JgNpIXaR/HPBxIbu2O8o P8Xt+8nlxZytN9YhcfCY8tdJMKqoumsnFiEozXbHvxzAsFWsNfPp8dh2o6s4vDyP0rs0 GvhA== X-Gm-Message-State: AJcUukclBmgMGahAd2hnRvFTk6slrr/Pp7baLrFEGyTrUaalcfQ/ttbI 22YmOk2jZGhr6spCRJr0ZmipcpZaBU4z1O3fxAA= X-Google-Smtp-Source: ALg8bN5rLCUFTe1zmBYmfrX0l5RhTO8yPMHYsJ2hF2QnCpsF8WxsAVsEExVq7UKYoipyXPZfJHZX6bERidgla1LQoFg= X-Received: by 2002:ab0:31d5:: with SMTP id e21mr7539580uan.107.1545822461100; Wed, 26 Dec 2018 03:07:41 -0800 (PST) In-Reply-To: <20181226053501.GA31843@debian.vc.shawcable.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::930 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14953 Eduardo A. Bustamante L=C3=B3pez =E4=BA=8E2018=E5=B9=B4= 12=E6=9C=8826=E6=97=A5=E5=91=A8=E4=B8=89 =E4=B8=8B=E5=8D=881:35=E5=86=99=E9= =81=93=EF=BC=9A > > On Mon, Dec 24, 2018 at 10:51:00AM +0800, chen liu wrote: > > Chet Ramey =E4=BA=8E2018=E5=B9=B412=E6=9C=8822=E6= =97=A5=E5=91=A8=E5=85=AD =E4=B8=8A=E5=8D=8812:51=E5=86=99=E9=81=93=EF=BC=9A > (...) > > > What is the hard limit on the number of processes for a process start= ed in > > > this environment? (The value of `ulimit -n'.) > > Ah, interesting. Thanks for the pointer Chet. > > (...) > > Below is all of the values of the bash ulimit optionals, this issue > > present in this environment > > ---------------------------------------------------------------------- > > root@localhost:/root> cat ulimit.txt > (...) > > max user processes (-u) 516046 > > virtual memory (kbytes, -v) unlimited > > file locks (-x) unlimited > > -----------------------------------------------------------------------= ---- > > But found change the -u optionals value through the ( ulimit -u 1024) > > will let this issue disapeared. > > As you probably found out already, the changes between 4.3 and 4.4 that m= ake > this issue "disappear" are related to how bash stores the exit status of > child processes. > > The threads that prompted this change provide some insight: > > - https://lists.gnu.org/archive/html/bug-bash/2015-04/msg00069.html Thanks for you support:) The change has introduced in bash since bash-4.4-alpha. This patch fixed this issue. And the note in Changelog ---------------------------------------------------------------------------= --------------------------- jobs.c - delete_job: only add J_ASYNC (and not J_FOREGROUND) jobs to the bgpids array, since Posix says shells only need to save the status of async jobs. Report and fix from John Fremlin ---------------------------------------------------------------------------= ------------------------------ Thanks, Chen. > - http://lists.gnu.org/archive/html/bug-bash/2015-04/msg00075.html > > And the note in the changelog: > > http://git.savannah.gnu.org/cgit/bash.git/tree/CWRU/old-changelogs/CWRU.c= hlog.v15?h=3Dab8ded9c30b51a6bc0c8145553263da044b565ea#n9811 > > > jobs.[ch] > > - bgpids: new implementation from a patch from John Fremlin > > , uses an array for the list of the last CHILD_MAX > > terminated background pids, and a separate hash table to search= it. > > The storage can be freed as a unit, and the size of the hash ta= ble > > (currently 4096) is independent of the size of the bgpids table > > http://git.savannah.gnu.org/cgit/bash.git/tree/CHANGES-4.4?h=3Dab8ded9c30= b51a6bc0c8145553263da044b565ea#n220 > > > e. There is a new implementation of the code that saves the last CHILD= _MAX > > exited background pids so their status can be queried later.