swupdate uses 94% Virtual Memory (VSZ) on less resource device

113 views
Skip to first unread message

Bharathiraja Nallathambi

unread,
May 19, 2022, 9:47:41 AM5/19/22
to swup...@googlegroups.com
Hi,
We are using at91sam9260 SOC based device with 64 megabyte RAM and 256 megabyte NAND flash storage.

We build custom Linux using yocto.

We are using Swupdate (Swupdate v2021.11.0) for device update.

On the device, swupdate uses 94% Virtual Memory (VSZ).

Need help here to reduce the % of Virtual Memory (VSZ) usage.

Please find the more details given below,

swupdate ps:

root@g6200:~# ps | grep swupdate
403 root 51908 S /usr/bin/swupdate -o /home/root/temptrak-swu-g6200.swu -f /etc/swupdate.cfg -e stable copy1 -u -x
418 root 52456 S /usr/bin/swupdate -o /home/root/temptrak-swu-g6200.swu -f /etc/swupdate.cfg -e stable copy1 -u -x
438 root 3124 S grep swupdate


Top:

root@g6200:~# top
Mem: 30764K used, 24480K free, 164K shrd, 0K buff, 11540K cached
CPU: 0% usr 23% sys 0% nic 76% idle 0% io 0% irq 0% sirq
Load average: 0.00 0.07 0.15 1/58 440
PID PPID USER STAT VSZ %VSZ %CPU COMMAND
440 432 root R 3124 6% 23% top
418 403 root S 52456 95% 0% /usr/bin/swupdate -o /home/root/temptrak-swu-g6200.swu -f /etc/swupdate.cfg -e stable copy1 -u -x
403 1 root S 51908 94% 0% /usr/bin/swupdate -o /home/root/temptrak-swu-g6200.swu -f /etc/swupdate.cfg -e stable copy1 -u -x


Swupdate.cfg:

globals :
{
verbose = true;
loglevel = 5;
syslog = true;
};

identify : (
{ name = "hwId"; value = "M500"; },
{ name = "hwVersion"; value = "R2"; },
{ name = "serialNo"; value = "1234567890"; }
);

suricatta :
{
tenant = "DEFAULT";
id = "g6200-4A:C7:7C:2C:4D:6C";
confirm = 0;
url="https://xxxxota.xxxxxxx.io";
polldelay = 300;
retry = 4;
retrywait = 200;
loglevel = 10;
};

CPU info:

root@g6200:~# cat /proc/cpuinfo
processor : 0
model name : ARM926EJ-S rev 5 (v5l)
BogoMIPS : 24.87
Features : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant : 0x0
CPU part : 0x926
CPU revision : 5

Hardware : Atmel AT91SAM9
Revision : 0000
Serial : 0000000000000000

Meminfo:

root@g6200:~# cat /proc/meminfo
MemTotal: 55244 kB
MemFree: 24444 kB
MemAvailable: 32468 kB
Buffers: 0 kB
Cached: 11552 kB
SwapCached: 0 kB
Active: 3896 kB
Inactive: 13452 kB
Active(anon): 152 kB
Inactive(anon): 7452 kB
Active(file): 3744 kB
Inactive(file): 6000 kB
Unevictable: 1988 kB
Mlocked: 1988 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 4 kB
Writeback: 0 kB
AnonPages: 7784 kB
Mapped: 9144 kB
Shmem: 176 kB
KReclaimable: 1696 kB
Slab: 5072 kB
SReclaimable: 1696 kB
SUnreclaim: 3376 kB
KernelStack: 464 kB
PageTables: 520 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 27620 kB
Committed_AS: 106564 kB
VmallocTotal: 966656 kB
VmallocUsed: 3236 kB
VmallocChunk: 0 kB
Percpu: 128 kB


Vmstat:

root@g6200:~# cat /proc/vmstat | grep -i page
nr_free_pages 6084
nr_page_table_pages 134
nr_anon_pages 1963
nr_file_pages 2888
nr_shmem_hugepages 0
nr_file_hugepages 0
nr_anon_transparent_hugepages 0
pageoutrun 0
drop_pagecache 0

uname:

root@g6200:~# uname -a
Linux g6200 5.10.112-cip6-mainline #1 Mon Apr 25 07:05:52 UTC 2022 armv5tejl GNU/Linux

Memory map:

lr-------- 1 root root 64 May 10 17:13 b6fc5000-b6fc6000 -> /lib/ld-linux.so.3
lr-------- 1 root root 64 May 10 17:13 b6fc3000-b6fc5000 -> /lib/ld-linux.so.3
lr-------- 1 root root 64 May 10 17:13 b6f8a000-b6fb3000 -> /lib/ld-linux.so.3
lr-------- 1 root root 64 May 10 17:13 b6f87000-b6f89000 -> /usr/lib/libcurl.so.4.7.0
lr-------- 1 root root 64 May 10 17:13 b6f86000-b6f87000 -> /usr/lib/libcurl.so.4.7.0
lr-------- 1 root root 64 May 10 17:13 b6f76000-b6f86000 -> /usr/lib/libcurl.so.4.7.0
lr-------- 1 root root 64 May 10 17:13 b6f10000-b6f76000 -> /usr/lib/libcurl.so.4.7.0
lr-------- 1 root root 64 May 10 17:13 b6f0a000-b6f0b000 -> /usr/lib/libconfig.so.11.1.0
lr-------- 1 root root 64 May 10 17:13 b6f09000-b6f0a000 -> /usr/lib/libconfig.so.11.1.0
lr-------- 1 root root 64 May 10 17:13 b6efa000-b6f09000 -> /usr/lib/libconfig.so.11.1.0
lr-------- 1 root root 64 May 10 17:13 b6ef0000-b6efa000 -> /usr/lib/libconfig.so.11.1.0
lr-------- 1 root root 64 May 10 17:13 b6eed000-b6eee000 -> /usr/lib/libjson-c.so.5.1.0
lr-------- 1 root root 64 May 10 17:13 b6eec000-b6eed000 -> /usr/lib/libjson-c.so.5.1.0
lr-------- 1 root root 64 May 10 17:13 b6edd000-b6eec000 -> /usr/lib/libjson-c.so.5.1.0
lr-------- 1 root root 64 May 10 17:13 b6ed0000-b6edd000 -> /usr/lib/libjson-c.so.5.1.0
lr-------- 1 root root 64 May 10 17:13 b6ec1000-b6ec3000 -> /usr/lib/libcrypto.so.3
lr-------- 1 root root 64 May 10 17:13 b6e94000-b6ec1000 -> /usr/lib/libcrypto.so.3
lr-------- 1 root root 64 May 10 17:13 b6e85000-b6e94000 -> /usr/lib/libcrypto.so.3
lr-------- 1 root root 64 May 10 17:13 b6bc0000-b6e85000 -> /usr/lib/libcrypto.so.3
lr-------- 1 root root 64 May 10 17:13 b6bb4000-b6bb5000 -> /lib/libz.so.1.2.11
lr-------- 1 root root 64 May 10 17:13 b6bb3000-b6bb4000 -> /lib/libz.so.1.2.11
lr-------- 1 root root 64 May 10 17:13 b6ba4000-b6bb3000 -> /lib/libz.so.1.2.11
lr-------- 1 root root 64 May 10 17:13 b6b90000-b6ba4000 -> /lib/libz.so.1.2.11
lr-------- 1 root root 64 May 10 17:13 b6b84000-b6b85000 -> /usr/lib/libubootenv.so.0.3.2
lr-------- 1 root root 64 May 10 17:13 b6b83000-b6b84000 -> /usr/lib/libubootenv.so.0.3.2
lr-------- 1 root root 64 May 10 17:13 b6b73000-b6b83000 -> /usr/lib/libubootenv.so.0.3.2
lr-------- 1 root root 64 May 10 17:13 b6b70000-b6b73000 -> /usr/lib/libubootenv.so.0.3.2
lr-------- 1 root root 64 May 10 17:13 b6b62000-b6b64000 -> /lib/libc.so.6
lr-------- 1 root root 64 May 10 17:13 b6b60000-b6b62000 -> /lib/libc.so.6
lr-------- 1 root root 64 May 10 17:13 b6b51000-b6b60000 -> /lib/libc.so.6
lr-------- 1 root root 64 May 10 17:13 b69f0000-b6b51000 -> /lib/libc.so.6
lr-------- 1 root root 64 May 10 17:13 b69df000-b69e0000 -> /usr/lib/libidn2.so.0.3.7
lr-------- 1 root root 64 May 10 17:13 b69de000-b69df000 -> /usr/lib/libidn2.so.0.3.7
lr-------- 1 root root 64 May 10 17:13 b69cf000-b69de000 -> /usr/lib/libidn2.so.0.3.7
lr-------- 1 root root 64 May 10 17:13 b69b0000-b69cf000 -> /usr/lib/libidn2.so.0.3.7
lr-------- 1 root root 64 May 10 17:13 b69a0000-b69a3000 -> /usr/lib/libssl.so.3
lr-------- 1 root root 64 May 10 17:13 b699a000-b69a0000 -> /usr/lib/libssl.so.3
lr-------- 1 root root 64 May 10 17:13 b698b000-b699a000 -> /usr/lib/libssl.so.3
lr-------- 1 root root 64 May 10 17:13 b6910000-b698b000 -> /usr/lib/libssl.so.3
lr-------- 1 root root 64 May 10 17:13 b6905000-b6906000 -> /usr/lib/libatomic.so.1.2.0
lr-------- 1 root root 64 May 10 17:13 b6904000-b6905000 -> /usr/lib/libatomic.so.1.2.0
lr-------- 1 root root 64 May 10 17:13 b68f5000-b6904000 -> /usr/lib/libatomic.so.1.2.0
lr-------- 1 root root 64 May 10 17:13 b68f0000-b68f5000 -> /usr/lib/libatomic.so.1.2.0
lr-------- 1 root root 64 May 10 17:13 b68e6000-b68e7000 -> /usr/lib/libunistring.so.2.2.0
lr-------- 1 root root 64 May 10 17:13 b68e3000-b68e6000 -> /usr/lib/libunistring.so.2.2.0
lr-------- 1 root root 64 May 10 17:13 b68d4000-b68e3000 -> /usr/lib/libunistring.so.2.2.0
lr-------- 1 root root 64 May 10 17:13 b6740000-b68d4000 -> /usr/lib/libunistring.so.2.2.0
lr-------- 1 root root 64 May 10 17:13 481000-482000 -> /usr/bin/swupdate
lr-------- 1 root root 64 May 10 17:13 480000-481000 -> /usr/bin/swupdate
lr-------- 1 root root 64 May 10 17:13 430000-471000 -> /usr/bin/swupdate

Can someone help here, Need help to reduce the % of Virtual Memory (VSZ) usage by swupdate.

Thanks and Regards,
Bharathiraja Nallathambi


Michael Adler

unread,
May 20, 2022, 5:37:44 AM5/20/22
to Bharathiraja Nallathambi, swup...@googlegroups.com
Hi,

do you have streaming mode (installed-directly) enabled for your swu file?
Maybe you could share your sw-description.

Kind Regards,
Michael

--
Michael Adler

Siemens AG
T CED SES-DE
Otto-Hahn-Ring 6
81739 München, Deutschland

Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Jim Hagemann Snabe; Vorstand: Roland Busch, Vorsitzender; Klaus Helmrich, Cedrik Neike, Matthias Rebellius, Ralf P. Thomas, Judith Wiese; Sitz der Gesellschaft: Berlin und München, Deutschland; Registergericht: Berlin-Charlottenburg, HRB 12300, München, HRB 6684; WEEE-Reg.-Nr. DE 23691322

Stefano Babic

unread,
May 20, 2022, 5:58:53 AM5/20/22
to Michael Adler, Bharathiraja Nallathambi, swup...@googlegroups.com
Hi,

On 20.05.22 11:36, Michael Adler wrote:
> Hi,
>
> do you have streaming mode (installed-directly) enabled for your swu file?
> Maybe you could share your sw-description.
>

I do not think this depends on sw-description. Anyway, this is *not* the
memory SWUpdate is currently using. The VSZ reports the virtual size
memory, the RES field (then I suggest to use plain ps from coreutils
instead of the one from busybox) reports how much memory belongs to
SWUpdate. And checking in the output, the system has:

root@g6200:~# cat /proc/meminfo MemTotal: 55244 kB
MemFree: 24444 kB
MemAvailable: 32468 kB

so apparently, 32MB are still availbale when needed, and 24MB are even
not used by any kernel buffer. The device has still memory (50% of the
total size).

The VSZ is not coming from SWUpdate itself, but from the shared
libraries that are memory mapped (libcurl, libconfig, etc.).

Best regards,
Stefano

> Kind Regards,
> Michael
>


--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================
Reply all
Reply to author
Forward
0 new messages