Allmon3 memory usage

Is it typical to see the resident memory of allmon3 creep up and up over time? Another system admin on our end is questioning the RAM usage of allmon3.

I have two rpi3 running raspbian trixie + ASL3. Both have uptimes of ~ 2 days and the RES ram for allmon3 is at a crazy 412MB and 452MB and seems to keep climbing.

Both pi’s have light to no allmon3 actual usage (the web page is not particularly used).

pi3 (1)

********** AllStarLink [ASL] Version Info **********

OS : Debian GNU/Linux 13 (trixie)
OS Kernel : 6.12.62+rpt-rpi-v8

Asterisk : 22.7.0+asl3-3.7.1-1.deb13
ASL [app_rpt] : 3.7.1

Installed ASL packages :

Package Version
============================== ==============================
allmon3 1.7.0-1.deb13
asl3 3.15-1.deb13
asl3-asterisk 2:22.7.0+asl3-3.7.1-1.deb13
asl3-asterisk-config 2:22.7.0+asl3-3.7.1-1.deb13
asl3-asterisk-modules 2:22.7.0+asl3-3.7.1-1.deb13
asl3-menu 1.16-1.deb13
asl3-update-nodelist 2.0.0-1.deb13
asl-apt-repos 2.0-1.deb13
dahdi 1:3.1.0-2.1
dahdi-dkms 1:3.4.0-10.asl.deb13
dahdi-linux 1:3.4.0-10.asl.deb13
dahdi-source 1:3.4.0-10.asl.deb13

pi3 (2)

********** AllStarLink [ASL] Version Info **********

OS : Debian GNU/Linux 13 (trixie)
OS Kernel : 6.12.62+rpt-rpi-v8

Asterisk : 22.8.2+asl3-3.8.2-1.deb13
ASL [app_rpt] : 3.8.2

Installed ASL packages :

Package Version
============================== ==============================
allmon3 1.7.0-1.deb13
asl3 3.17-1.deb13
asl3-asterisk 2:22.8.2+asl3-3.8.2-1.deb13
asl3-asterisk-config 2:22.8.2+asl3-3.8.2-1.deb13
asl3-asterisk-modules 2:22.8.2+asl3-3.8.2-1.deb13
asl3-menu 1.18-1.deb13
asl-apt-repos 2.0-1.deb13
dahdi 1:3.1.0-2.1
dahdi-dkms 1:3.4.0-11.asl.deb13
dahdi-linux 1:3.4.0-11.asl.deb13
dahdi-source 1:3.4.0-11.asl.deb13

AFAICS the memory usage will step up for each logged in monitoring console. The amount of resident memory will fluctuate with the system state, normally.

Valgrind shows no memory leaks in the current version of allmon3.

Hmm. It would be safe to say that there are zero or one logged in users max on these two devices at any time for allmon3. If there are any users of Raspbian Trixie + ASL3 + allmon3 that can say what their RES values for memory are after a few days that would be interesting.

top - 16:01:16 up 2 days, 21:25,  1 user,  load average: 0.19, 0.26, 0.26
Tasks: 175 total,   1 running, 174 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2.7 us,  2.6 sy,  0.0 ni, 94.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st 
MiB Mem :   7820.7 total,   6644.4 free,    911.8 used,    363.6 buff/cache     
MiB Swap:   2048.0 total,   2048.0 free,      0.0 used.   6908.8 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                          
   2077 allmon3   20   0  815452 558620  14808 S   0.7   7.0   8:57.37 allmon3  

That number there looks high to me. I would assume that the system will trim out the RAM from allmon3 if it is needed elsewhere?

The above example that machine has 8GB of RAM, but a pi3 will have 1GB. Seven percent RAM vs 50+% heh.

that's what SWAP is for .. beware the default swap size delivered by a standard Raspi OS install

1 Like
top - 17:24:29 up 9 min,  1 user,  load average: 0.08, 0.15, 0.14
Tasks: 181 total,   1 running, 180 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.3 us,  0.3 sy,  0.0 ni, 99.2 id,  0.0 wa,  0.0 hi,  0.1 si,  0.0 st 
MiB Mem :   7820.7 total,   7209.2 free,    411.6 used,    291.7 buff/cache     
MiB Swap:   2048.0 total,   2048.0 free,      0.0 used.   7409.0 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                          
   2131 allmon3   20   0  224120  65244  14684 S   1.0   0.8   0:05.24 allmon3                                                                          

I see anywhere from 500k to 800k bytes of virtual memory used after a week or two, so I don't worry as long as the resident memory is <= that value. :slightly_smiling_face:

Just because the number looks big doesn't mean it's necessarily a worry. You may have noticed that allmon3 uses Python, so what's loaded in memory in part is whatever the language pulls in during execution.

Let us know if you observe an unbounded memory usage increase.

I have seen unreasonable memory inflation if you have someone on the internet who does a drive-by on the websockets and blast the crap out of them. Something that was doing that to Node 2004 a week or so ago. Finally went away.

Allmon3 is all Python which is not a memory-lightweight. IT also stores the entire “Allmon DB” in memory.

previous was a raspi4, now this from a raspi3 1GB replacement

top - 15:07:33 up 57 min,  1 user,  load average: 0.16, 0.17, 0.12
Tasks: 154 total,   2 running, 152 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.7 us,  1.3 sy,  0.0 ni, 95.9 id,  0.0 wa,  0.0 hi,  2.1 si,  0.0 st 
MiB Mem :    906.0 total,    342.3 free,    352.1 used,    270.2 buff/cache     
MiB Swap:    905.0 total,    905.0 free,      0.0 used.    553.9 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                      
   3155 allmon3   20   0  324624  66744  14860 S   2.0   7.2   0:25.11 allmon3                                                      

That looks like you just fired up and have one login if I'm reading the tea leaves correctly. I see 800k/400k, more like your first posting, on an RPi5 after 24 hr and ~1000 keyups on a net with 100-250 nodes.

Fortunately I have no pathologically connecting nodes, so @N8EI's caveat does not apply.

yes, freshly configured raspi3 .. will let that simmer a few days and then report once more

raspi3 with two interfaces connected to ECR most of the time (last report)

top - 14:42:37 up 3 days, 20:46,  1 user,  load average: 0.25, 0.37, 0.41
Tasks: 161 total,   1 running, 160 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.5 us,  3.5 sy,  0.0 ni, 94.8 id,  0.0 wa,  0.0 hi,  0.2 si,  0.0 st 
MiB Mem :    906.0 total,    280.9 free,    393.7 used,    308.9 buff/cache     
MiB Swap:    905.0 total,    905.0 free,      0.0 used.    512.3 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                           
    866 allmon3   20   0  329556  72332  14844 S   3.6   7.8 171:37.79 allmon3                                                                           

memory usage appears to be nothing much to worry about