From 6fa4cdf7e3dcfa0ede6e5b976e185dff6893f8b3 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 7 Aug 2024 15:29:57 +0200 Subject: [PATCH] services.cgi: Use new functions to figure out memory usage Signed-off-by: Michael Tremer --- html/cgi-bin/services.cgi | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi index 678b31547..91cdd3958 100644 --- a/html/cgi-bin/services.cgi +++ b/html/cgi-bin/services.cgi @@ -232,17 +232,13 @@ sub isrunningaddon (@) { my @pid = split(/\s/,$testcmd); $status .="$pid[0]"; - my $memory = 0; + # Fetch the memory consumption + my $memory = &General::get_memory_consumption(@pid); - foreach (@pid){ - chomp($_); - if (open(FILE, "/proc/$_/statm")){ - my $temp = ; - @memory = split(/ /,$temp); - } - $memory+=$memory[0]; - } - $status .="$memory KB"; + # Format memory + $memory = &General::formatBytes($memory); + + $status .="$memory"; }else{ $status = "$Lang::tr{"; $status .= "$Lang::tr{'stopped'}"; -- 2.39.5