Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: abhishpaliwal Newsgroups: gnu.bash.bug Subject: memory leak in bash only during boot up in Bash-3.2.48 Date: Tue, 18 Dec 2018 22:54:14 -0700 (MST) Lines: 90 Approved: bug-bash@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1545230750 26260 208.118.235.17 (19 Dec 2018 14:45:50 GMT) X-Complaints-To: action@cs.stanford.edu To: Bug-bash@gnu.org Envelope-to: Bug-bash@gnu.org X-detected-operating-system: by eggs.gnu.org: Mac OS X [generic] [fuzzy] X-Received-From: 162.253.133.57 X-Mailman-Approved-At: Wed, 19 Dec 2018 09:45:49 -0500 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:14926 create a shell script from below given code. name it testing.sh. #!/bin/bash logger "Started testing" while(true); do while (true); do ls > /dev/null ; done done Steps. # chmod 755 /root/testing.sh modify any /etc/init.d/"service" file add "/root/testing.sh" inside the start case. "service" is any service file starting during start up. Make sure above service is started during the startup. Example : Add testing to audit init script start(){ echo -n "Starting testing.sh" /root/testing.sh & After boot up root@localhost:/root> ps fax | grep testing 751 ? S 0:11 /bin/bash /root/testing.sh 9684 ttyS0 S+ 0:00 \_ grep testing root@localhost:/root> cat /proc/751/smaps | grep -A10 heap 01419000-016ad000 rw-p 00000000 00:00 0 [heap] Size: 2640 kB Rss: 2536 kB Pss: 2536 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 0 kB Private_Dirty: 2536 kB Referenced: 2536 kB Swap: 0 kB KernelPageSize: 4 kB root@localhost:/root> cat /proc/751/smaps | grep -A10 heap 01419000-016ce000 rw-p 00000000 00:00 0 [heap] Size: 2772 kB Rss: 2740 kB Pss: 2734 kB Shared_Clean: 0 kB Shared_Dirty: 12 kB Private_Clean: 0 kB Private_Dirty: 2728 kB Referenced: 2740 kB Swap: 0 kB KernelPageSize: 4 kB But when we are testing the same on Bash-4.4.0, its not consuming the memory and steady as well, below are the logs root@localhost:/root> ps fax | grep testing 964 ? S 0:02 /bin/bash /root/testing.sh 11484 pts/0 S+ 0:00 \_ grep testing root@localhost:/root> cat /proc/964/smaps | grep -A10 heap 00b1b000-00b32000 rw-p 00000000 00:00 0 [heap] Size: 92 kB Rss: 88 kB Pss: 88 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 0 kB Private_Dirty: 88 kB Referenced: 88 kB Swap: 0 kB KernelPageSize: 4 kB root@localhost:/root> cat /proc/964/smaps | grep -A10 heap 00b1b000-00b32000 rw-p 00000000 00:00 0 [heap] Size: 92 kB Rss: 88 kB Pss: 60 kB Shared_Clean: 0 kB Shared_Dirty: 56 kB Private_Clean: 0 kB Private_Dirty: 32 kB Referenced: 88 kB Swap: 0 kB -- Sent from: http://gnu-bash.2382.n7.nabble.com/