Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Eduardo =?iso-8859-1?Q?A=2E_Bustamante_L=F3pez?= Newsgroups: gnu.bash.bug Subject: Re: Memory continusely increase Date: Tue, 25 Dec 2018 21:35:01 -0800 Lines: 46 Approved: bug-bash@gnu.org Message-ID: References: <1545199834453-0.post@n7.nabble.com> <8ba9e82f-020a-3bf5-87c5-ce250f89e269@case.edu> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: usenet.stanford.edu 1545802519 21458 208.118.235.17 (26 Dec 2018 05:35:19 GMT) X-Complaints-To: action@cs.stanford.edu Cc: chet.ramey@case.edu, bug-bash To: chen liu Envelope-to: Bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=3d22ipitYsi6dVdRW7o7LinpSflQc+adVnNc4KRP+dQ=; b=cEyUllvzzqJnA4FP7YrnjAGcWS+BsJdoyTXc1FmSFtjhQbURAmORmKsMUPEm6RBPaZ NFdG3XFh7RjVHo5+c3qSCzu7VaLWmDe8TzffH1IUjvDENLzlsZXvLGM6gfR4QoEZokAN 2AlHGCSJd+0jSQkjSjsMXzqyLRtevvZzee9AZKdKhQDCBrHPbBpbq4kOVn3X6RAr7FLi NZwa41S+F21JxF4FVOf43Dg+CKEkx5B7I9beFvUWGHjq41PjPduY6Bt0ApcLarLBG156 mBuvIAVP/MA64bn14I/zNVaX8rW2Sg/ePVXyCvM4qmqjQtj2tJpOzvWneBP4ycXZMJUr os7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=3d22ipitYsi6dVdRW7o7LinpSflQc+adVnNc4KRP+dQ=; b=BFTGiIJ1XMNHORlESy0DEgPtIW9N331Ap4rO/Mk88u8AXRVAJubGnY2tS9oy9CckPN rSYUMvnb1XsyDRowlPkhtd4Qox1+iPVpw1Hxd+taRETlZy0XQUUVKVfmDQ4P24nShJnK OVZks1jqyXURQHv3nr6tyuzC7n/Rtf9Dfe7YwGfsktobJ3YoKmxdlugby0GZCm+nw33C vpAI2QdBtCcTaQOBi6apAKprwQbwXFtPVv0ZRDmyzV7/sJgAn68jwGA0nO7qOLxJSVLc wWh8D8IyYpR9nCVf9cPJhNj5gZhhMaLGY+kYLb1TsjHr/bBFtSheezo/Vcw0pWN7Bqwp hhSg== X-Gm-Message-State: AJcUuke0f+3cBT2eyICHjUzpby/LVSJK4iEblPZF+8MytrAUCLCRNzmB ufjC/zJ5DJhAcWT9LUKUfpo= X-Google-Smtp-Source: ALg8bN701dZiIO1NRYT8VhFvjAuireJaCuN1DC9goaNAMU//08mI38EP86Qxc8OMHFqgsXy411E9cg== X-Received: by 2002:a17:902:887:: with SMTP id 7mr18458085pll.164.1545802504200; Tue, 25 Dec 2018 21:35:04 -0800 (PST) Mail-Followup-To: chen liu , chet.ramey@case.edu, bug-bash Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::635 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:14952 On Mon, Dec 24, 2018 at 10:51:00AM +0800, chen liu wrote: > Chet Ramey 于2018年12月22日周六 上午12:51写道: (...) > > What is the hard limit on the number of processes for a process started 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 make 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 - 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.chlog.v15?h=ab8ded9c30b51a6bc0c8145553263da044b565ea#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 table > (currently 4096) is independent of the size of the bgpids table http://git.savannah.gnu.org/cgit/bash.git/tree/CHANGES-4.4?h=ab8ded9c30b51a6bc0c8145553263da044b565ea#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.