Vfork: Out of memory

hi,
I have any error after update packages:

`root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/releases/18.06.0-rc1/targets/brcm63xx/generic/packages/Packages.gz
*** Failed to download the package list from http://downloads.openwrt.org/releases/18.06.0-rc1/targets/brcm63xx/generic/packages/Packages.gz

Downloading http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/base/Packages.gz
*** Failed to download the package list from http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/base/Packages.gz

Downloading http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/luci/Packages.gz
*** Failed to download the package list from http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/luci/Packages.gz

Downloading http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/packages/Packages.gz
*** Failed to download the package list from http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/packages/Packages.gz

Downloading http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/routing/Packages.gz
*** Failed to download the package list from http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/routing/Packages.gz

Downloading http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/telephony/Packages.gz
*** Failed to download the package list from http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/telephony/Packages.gz

Collected errors:
 * xsystem: wget: vfork: Out of memory.
 * opkg_download: Failed to download http://downloads.openwrt.org/releases/18.06.0-rc1/targets/brcm63xx/generic/packages/Packages.gz, wget returned -1.
 * xsystem: wget: vfork: Out of memory.
 * opkg_download: Failed to download http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/base/Packages.gz, wget returned -1.
 * xsystem: wget: vfork: Out of memory.
 * opkg_download: Failed to download http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/luci/Packages.gz, wget returned -1.
 * xsystem: wget: vfork: Out of memory.
 * opkg_download: Failed to download http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/packages/Packages.gz, wget returned -1.
 * xsystem: wget: vfork: Out of memory.
 * opkg_download: Failed to download http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/routing/Packages.gz, wget returned -1.
 * xsystem: wget: vfork: Out of memory.
 * opkg_download: Failed to download http://downloads.openwrt.org/releases/18.06.0-rc1/packages/mips_mips32/telephony/Packages.gz, wget returned -1.
root@OpenWrt:~# `

why ?

https://openwrt.org/toh/pirelli/agpf -- 32 MB RAM

https://openwrt.org/supported_devices/432_warning

but I have memory free:

root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.5M      2.5M         0 100% /rom
tmpfs                    13.6M      1.2M     12.4M   9% /tmp
/dev/mtdblock5           12.0M      4.4M      7.6M  37% /overlay
overlayfs:/overlay       12.0M      4.4M      7.6M  37% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# 

You may have free flash, but not enough free RAM.

1 Like

this is my memory use:

root@OpenWrt:~# free
             total       used       free     shared    buffers     cached
Mem:         27872      23396       4476       1340       2032       7088
-/+ buffers/cache:      14276      13596
Swap:            0          0          0
root@OpenWrt:~# 

and:

cat /proc/meminfo
MemTotal:          27872 kB
MemFree:            4224 kB
MemAvailable:      10076 kB
Buffers:            2032 kB
Cached:             7088 kB
SwapCached:            0 kB
Active:             8852 kB
Inactive:           2412 kB
Active(anon):       3416 kB
Inactive(anon):       68 kB
Active(file):       5436 kB
Inactive(file):     2344 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:          2152 kB
Mapped:             2592 kB
Shmem:              1340 kB
Slab:               6204 kB
SReclaimable:       1772 kB
SUnreclaim:         4432 kB
KernelStack:         464 kB
PageTables:          296 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:       13936 kB
Committed_AS:       7664 kB
VmallocTotal:    1032116 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
root@OpenWrt:~# 

You are in fact, out-of-memory. That's about half of my available space on a 32 MB memory device.

root@OpenWrt:~# cat /proc/meminfo
MemTotal:          28576 kB
MemFree:            8076 kB
MemAvailable:      14472 kB
Buffers:            1952 kB
Cached:             7080 kB

is not sufficient 4 Mb free ram memory ?

Apparently not enough to run wget along with what you've already got running on the device.

1 Like

A package manager is a complex piece of software, the complexity raises with the number of packages and their interdependencies. Your figures only show the amount of free RAM before you invoke a RAM hungry (relative to the amount of free RAM you can offer) application.

1 Like

ok. How I can to free ram memory ?

Turn off wireless, uhttpd, DHCP, DNS, NTP, and all other services you don't need at that moment.

1 Like

How I can to see active process ?

  • Using the command top
  • Also on the Status > Processes page on the web GUI (but I don't think you have enough memory to load the page).

top command:

Mem: 24380K used, 3492K free, 1340K shrd, 2036K buff, 7268K cached
CPU:  29% usr  38% sys   0% nic  31% idle   0% io   0% irq   0% sirq
Load average: 1.64 1.51 1.20 3/57 18372
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 3233     1 root     D     1384   5%   1% luci-bwc 9
18014  1390 root     R     1348   5%   1% top
  645     1 root     S     1588   6%   1% /sbin/rpcd
  427     1 root     S     1224   4%   0% /sbin/ubusd
 1134     2 root     SW       0   0%   0% [irq/39-b43]
    3     2 root     SW       0   0%   0% [ksoftirqd/0]
    8     2 root     SW       0   0%   0% [kworker/u2:1]
  759     1 root     S     1804   6%   0% /sbin/netifd
  885     1 root     S     1608   6%   0% /usr/sbin/uhttpd -f -h /www -r OpenWrt -x /cgi-bin -u /ubus -t 60 -T 30 -k 20 -A 1 -n 3 -N 100 -R -p 0.
 1277     1 dnsmasq  S     1400   5%   0% /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid
 1239   855 root     S     1132   4%   0% /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T 3
  111     2 root     SW       0   0%   0% [kworker/0:1]
12949     2 root     SW       0   0%   0% [kworker/u2:0]
  991     1 root     S     3700  13%   0% /usr/sbin/collectd -f
18361   885 root     R     3228  12%   0% {luci} /usr/bin/lua /www/cgi-bin/luci
 1204     1 root     S     1868   7%   0% /usr/sbin/wpa_supplicant -B -P /var/run/wpa_supplicant-wlan0.pid -D nl80211 -i wlan0 -c /var/run/wpa_su
    1     0 root     S     1592   6%   0% /sbin/procd
  795     1 root     S     1472   5%   0% /usr/sbin/odhcpd
  822     1 root     S     1348   5%   0% /usr/sbin/crond -f -c /etc/crontabs -l 8
 1470     1 root     S<    1344   5%   0% /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org -p 2
 1390  1239 root     S     1344   5%   0% -ash
 1256   759 root     S     1344   5%   0% udhcpc -p /var/run/udhcpc-wlan0.pid -s /lib/netifd/dhcp.script -f -t 0 -i wlan0 -x hostname:OpenWrt -C
  628     1 root     S     1248   4%   0% /sbin/logd -S 64
  855     1 root     S     1064   4%   0% /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T 3
18372 12949 root     R     1040   4%   0% /sbin/modprobe -q -- ath4
  428     1 root     S      900   3%   0% /sbin/askfirst /bin/ash --login
 3922     2 root     SW       0   0%   0% [kworker/u2:3]
  380     2 root     SWN      0   0%   0% [jffs2_gcd_mtd5]
  118     2 root     SW       0   0%   0% [kswapd0]
  271     2 root     SW<      0   0%   0% [ipv6_addrconf]
  239     2 root     SW       0   0%   0% [spi0]
  296     2 root     SW<      0   0%   0% [kworker/0:1H]
  228     2 root     SW<      0   0%   0% [bioset]

ps command:

root@OpenWrt:~# ps
  PID USER       VSZ STAT COMMAND
    1 root      1592 S    /sbin/procd
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    5 root         0 SW<  [kworker/0:0H]
    7 root         0 SW<  [lru-add-drain]
    8 root         0 SW   [kworker/u2:1]
   20 root         0 SW   [oom_reaper]
   73 root         0 SW<  [writeback]
   75 root         0 SW<  [crypto]
   76 root         0 SW<  [bioset]
   78 root         0 SW<  [kblockd]
   91 root         0 SW<  [watchdogd]
  111 root         0 SW   [kworker/0:1]
  118 root         0 SW   [kswapd0]
  208 root         0 SW<  [bioset]
  213 root         0 SW<  [bioset]
  218 root         0 SW<  [bioset]
  223 root         0 SW<  [bioset]
  228 root         0 SW<  [bioset]
  233 root         0 SW<  [bioset]
  239 root         0 SW   [spi0]
  271 root         0 SW<  [ipv6_addrconf]
  296 root         0 SW<  [kworker/0:1H]
  380 root         0 SWN  [jffs2_gcd_mtd5]
  427 root      1224 S    /sbin/ubusd
  428 root       900 S    /sbin/askfirst /bin/ash --login
  500 root         0 SW<  [cfg80211]
  513 root         0 SW   [kworker/0:2]
  628 root      1248 S    /sbin/logd -S 64
  645 root      1588 S    /sbin/rpcd
  759 root      1804 S    /sbin/netifd
  795 root      1472 S    /usr/sbin/odhcpd
  822 root      1348 S    /usr/sbin/crond -f -c /etc/crontabs -l 8
  855 root      1064 S    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T 3
  885 root      1608 S    /usr/sbin/uhttpd -f -h /www -r OpenWrt -x /cgi-bin -u /ubus -t 60 -T 30 -k 20 -A 1 -n 3 -N 100 -R -p 0.0.0.0:80 -p [:
  991 root      3700 S    /usr/sbin/collectd -f
 1134 root         0 SW   [irq/39-b43]
 1204 root      1868 S    /usr/sbin/wpa_supplicant -B -P /var/run/wpa_supplicant-wlan0.pid -D nl80211 -i wlan0 -c /var/run/wpa_supplicant-wlan0
 1239 root      1132 S    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300 -T 3
 1256 root      1344 S    udhcpc -p /var/run/udhcpc-wlan0.pid -s /lib/netifd/dhcp.script -f -t 0 -i wlan0 -x hostname:OpenWrt -C -O 121
 1277 dnsmasq   1400 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid
 1390 root      1344 S    -ash
 1470 root      1344 S<   /usr/sbin/ntpd -n -N -S /usr/sbin/ntpd-hotplug -p 0.openwrt.pool.ntp.org -p 1.openwrt.pool.ntp.org -p 2.openwrt.pool.
 3233 root      1384 D    luci-bwc 9
 3922 root         0 SW   [kworker/u2:3]
12949 root         0 SW   [kworker/u2:0]
18833 root      1344 R    ps
18834 root      1068 R    /sbin/modprobe -q -- netdev-ath2
root@OpenWrt:~# 

1 Like

You notice that your memory is decreasing?

You CPU is running at full load (~100%) as well.

You web GUI is taking a lot of resources, I would definitely disable that.