help-bash
[Top][All Lists]
Advanced

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

Memory increase on bash process


From: Aviraj Cj (acj)
Subject: Memory increase on bash process
Date: Wed, 23 Jun 2021 18:37:59 +0000
User-agent: Microsoft-MacOutlook/16.49.21050901

Hello,

I am trying to upgrade the bash on our systems from 4.2 to 5.0, I am seeing 
some memory increase mostly in stack and heap of the bash processes…

Stack increase is always constant aprox 160-200 kbps per bash process and 
difference in heap increase is mostly seen because of sourcing of functions in 
below example I have sourced same functions the difference is more than 3 MB...

Any pointer on how to better profile these scripts and identify the problem 
area so it can be re written to avoid this memory increase and any idea why 
stack increase is seen or expected??


Bash-4.2:
bash-4.2#./pmap -X -q  9153
..
555bbaccd000 rw-p 00000000 00:00     0 6596 6468 6468 6468 6468 0 0 0 0 0 0 0 0 
0 [heap]
..
7fffbddce000 rw-p 00000000 00:00     0  384  384  384  384  384 0 0 0 0 0 0 0 0 
0 [stack]

bash-4.2# python ps_mem.py -p 3852
Private  +   Shared  =  RAM used   Program

  4.4 MiB + 514.5 KiB =   4.9 MiB   bash
---------------------------------
                          4.9 MiB
=================================

Bash-5.0:
bash-5.0# ./pmap -X -q  8503
…
555ba3a24000 rw-p 00000000 00:00     0 11724 11672 11672 11672 11672 0 0 0 0 0 
0 0 0 0 [heap]
…
7ffe33411000 rw-p 00000000 00:00     0   552   552   552   552   552 0 0 0 0 0 
0 0 0 0 [stack]

bash-5.0# python ps_mem.py -p 3684
Private  +   Shared  =  RAM used   Program

  8.0 MiB + 552.5 KiB =   8.5 MiB   bash
---------------------------------
                          8.5 MiB
=================================

TIA,
Aviraj

reply via email to

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