Out of memory Error - Raspberry Pi

1,195 views
Skip to first unread message

Francisco Puig

unread,
Feb 27, 2017, 11:18:00 AM2/27/17
to weewx-user
After 45 days running in a raspberry pi my weewx suddenly stopped. I found on the logs a "Out of memory: Kill process 472 (python) score 814 or sacrifice child" error. I restarted the weewx service and everything came back. Anyone has an idea whats triggered the out of memory? I'm attaching the logs for reference.

root@weather_bridge:~# sudo tail -f /var/log/syslog

Feb 27 06:45:26 weather_bridge kernel: [1878102.860076] [26269]     0 26269      475       18       5       0        0             0 man-db

Feb 27 06:45:26 weather_bridge kernel: [1878102.860100] [26272]     6 26272     3606     2582      10       0        0             0 mandb

Feb 27 06:45:26 weather_bridge kernel: [1878102.860119] Out of memory: Kill process 472 (python) score 814 or sacrifice child

Feb 27 06:45:26 weather_bridge kernel: [1878102.860239] Killed process 472 (python) total-vm:556264kB, anon-rss:363116kB, file-rss:0kB

Feb 27 06:45:27 weather_bridge apache2[26194]: Reloading web server: apache2.

Feb 27 06:45:27 weather_bridge CRON[26096]: (CRON) info (No MTA installed, discarding output)

Feb 27 07:17:01 weather_bridge CRON[26350]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Feb 27 08:17:01 weather_bridge CRON[26366]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Feb 27 09:17:01 weather_bridge CRON[26382]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Feb 27 10:17:01 weather_bridge CRON[26398]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)


root@weather_bridge:~# sudo /etc/init.d/weewx stop

[ ok ] Stopping weewx (via systemctl): weewx.service.


root@weather_bridge:~# sudo /etc/init.d/weewx start

[ ok ] Starting weewx (via systemctl): weewx.service.


root@weather_bridge:~# df

Filesystem     1K-blocks    Used Available Use% Mounted on

/dev/root       14859920 1038008  13188412   8% /

devtmpfs          218256       0    218256   0% /dev

tmpfs             222544       0    222544   0% /dev/shm

tmpfs             222544   24948    197596  12% /run

tmpfs               5120       4      5116   1% /run/lock

tmpfs             222544       0    222544   0% /sys/fs/cgroup

/dev/mmcblk0p1     63503   20593     42910  33% /boot

root@weather_bridge:~# 


mwall

unread,
Feb 27, 2017, 11:33:12 AM2/27/17
to weewx-user
On Monday, February 27, 2017 at 11:18:00 AM UTC-5, Francisco Puig wrote:
After 45 days running in a raspberry pi my weewx suddenly stopped. I found on the logs a "Out of memory: Kill process 472 (python) score 814 or sacrifice child" error. I restarted the weewx service and everything came back. Anyone has an idea whats triggered the out of memory? I'm attaching the logs for reference.

hello francisco,

it is not normal for weewx to consume large amounts of memory.

please post the log from just before weewx starts up until after two or three archive intervals.

m

mwall

unread,
Feb 27, 2017, 11:41:01 AM2/27/17
to weewx-user
francesco,

it would also help if you could post more context about why the out-of-memory killer was activated.  see the answer to this posting:

http://unix.stackexchange.com/questions/128642/debug-out-of-memory-with-var-log-messages

and post any oom/total_vm results you find:

sudo grep oom /var/log/*
sudo grep total_vm /var/log/*


m

Francisco Puig

unread,
Feb 27, 2017, 1:02:30 PM2/27/17
to weewx-user

@mwall , here is the logs. The last log is the Before and after the memory crash issue. I hope to find the reason, could be a memory leak in some place. I manually restarted the service at Feb 27 11:07:43.


root@weather_bridge:~# sudo grep oom /var/log/*

grep: /var/log/apache2: Is a directory

grep: /var/log/apt: Is a directory

/var/log/auth.log:Feb 27 12:51:09 weather_bridge sudo:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/grep oom /var/log/alternatives.log /var/log/apache2 /var/log/apt /var/log/auth.log /var/log/auth.log.1 /var/log/auth.log.2.gz /var/log/auth.log.3.gz /var/log/auth.log.4.gz /var/log/boot.log /var/log/bootstrap.log /var/log/btmp /var/log/daemon.log /var/log/daemon.log.1 /var/log/daemon.log.2.gz /var/log/daemon.log.3.gz /var/log/daemon.log.4.gz /var/log/debug /var/log/debug.1 /var/log/debug.2.gz /var/log/dmesg /var/log/dpkg.log /var/log/faillog /var/log/fsck /var/log/kern.log /var/log/kern.log.1 /var/log/kern.log.2.gz /var/log/kern.log.3.gz /var/log/kern.log.4.gz /var/log/lastlog /var/log/messages /var/log/messages.1 /var/log/messages.2.gz /var/log/messages.3.gz /var/log/messages.4.gz /var/log/ntpstats /var/log/samba /var/log/syslog /var/log/syslog.1 /var/log/syslog.2.gz /var/log/syslog.3.gz /var/log/syslog.4.gz /var/log/syslog.5.gz /var/log/syslog.6.gz /var/log/syslog.7.gz /var/log/user.lo

grep: /var/log/fsck: Is a directory

/var/log/kern.log:Feb 27 06:45:25 weather_bridge kernel: [1878102.857984] mandb invoked oom-killer: gfp_mask=0x26084c0, order=0, oom_score_adj=0

/var/log/kern.log:Feb 27 06:45:25 weather_bridge kernel: [1878102.858428] [<c012a3e4>] (dump_header) from [<c00dcd10>] (oom_kill_process+0x2b8/0x408)

/var/log/kern.log:Feb 27 06:45:25 weather_bridge kernel: [1878102.858460] [<c00dcd10>] (oom_kill_process) from [<c00dd1a4>] (out_of_memory+0x2cc/0x324)

/var/log/kern.log:Feb 27 06:45:26 weather_bridge kernel: [1878102.859209] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name

/var/log/messages:Feb 27 06:45:25 weather_bridge kernel: [1878102.857984] mandb invoked oom-killer: gfp_mask=0x26084c0, order=0, oom_score_adj=0

/var/log/messages:Feb 27 06:45:25 weather_bridge kernel: [1878102.858428] [<c012a3e4>] (dump_header) from [<c00dcd10>] (oom_kill_process+0x2b8/0x408)

/var/log/messages:Feb 27 06:45:25 weather_bridge kernel: [1878102.858460] [<c00dcd10>] (oom_kill_process) from [<c00dd1a4>] (out_of_memory+0x2cc/0x324)

/var/log/messages:Feb 27 06:45:26 weather_bridge kernel: [1878102.859209] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name

grep: /var/log/ntpstats: Is a directory

grep: /var/log/samba: Is a directory

/var/log/syslog:Feb 27 06:45:25 weather_bridge kernel: [1878102.857984] mandb invoked oom-killer: gfp_mask=0x26084c0, order=0, oom_score_adj=0

/var/log/syslog:Feb 27 06:45:25 weather_bridge kernel: [1878102.858428] [<c012a3e4>] (dump_header) from [<c00dcd10>] (oom_kill_process+0x2b8/0x408)

/var/log/syslog:Feb 27 06:45:25 weather_bridge kernel: [1878102.858460] [<c00dcd10>] (oom_kill_process) from [<c00dd1a4>] (out_of_memory+0x2cc/0x324)

/var/log/syslog:Feb 27 06:45:26 weather_bridge kernel: [1878102.859209] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name

root@weather_bridge:~# 


root@weather_bridge:~# sudo grep total_vm /var/log/*

grep: /var/log/apache2: Is a directory

grep: /var/log/apt: Is a directory

/var/log/auth.log:Feb 27 12:52:09 weather_bridge sudo:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/grep total_vm /var/log/alternatives.log /var/log/apache2 /var/log/apt /var/log/auth.log /var/log/auth.log.1 /var/log/auth.log.2.gz /var/log/auth.log.3.gz /var/log/auth.log.4.gz /var/log/boot.log /var/log/bootstrap.log /var/log/btmp /var/log/daemon.log /var/log/daemon.log.1 /var/log/daemon.log.2.gz /var/log/daemon.log.3.gz /var/log/daemon.log.4.gz /var/log/debug /var/log/debug.1 /var/log/debug.2.gz /var/log/dmesg /var/log/dpkg.log /var/log/faillog /var/log/fsck /var/log/kern.log /var/log/kern.log.1 /var/log/kern.log.2.gz /var/log/kern.log.3.gz /var/log/kern.log.4.gz /var/log/lastlog /var/log/messages /var/log/messages.1 /var/log/messages.2.gz /var/log/messages.3.gz /var/log/messages.4.gz /var/log/ntpstats /var/log/samba /var/log/syslog /var/log/syslog.1 /var/log/syslog.2.gz /var/log/syslog.3.gz /var/log/syslog.4.gz /var/log/syslog.5.gz /var/log/syslog.6.gz /var/log/syslog.7.gz

/var/log/auth.log:Feb 27 12:52:15 weather_bridge sudo:     root : TTY=pts/0 ; PWD=/root ; USER=root ; COMMAND=/bin/grep total_vm /var/log/alternatives.log /var/log/apache2 /var/log/apt /var/log/auth.log /var/log/auth.log.1 /var/log/auth.log.2.gz /var/log/auth.log.3.gz /var/log/auth.log.4.gz /var/log/boot.log /var/log/bootstrap.log /var/log/btmp /var/log/daemon.log /var/log/daemon.log.1 /var/log/daemon.log.2.gz /var/log/daemon.log.3.gz /var/log/daemon.log.4.gz /var/log/debug /var/log/debug.1 /var/log/debug.2.gz /var/log/dmesg /var/log/dpkg.log /var/log/faillog /var/log/fsck /var/log/kern.log /var/log/kern.log.1 /var/log/kern.log.2.gz /var/log/kern.log.3.gz /var/log/kern.log.4.gz /var/log/lastlog /var/log/messages /var/log/messages.1 /var/log/messages.2.gz /var/log/messages.3.gz /var/log/messages.4.gz /var/log/ntpstats /var/log/samba /var/log/syslog /var/log/syslog.1 /var/log/syslog.2.gz /var/log/syslog.3.gz /var/log/syslog.4.gz /var/log/syslog.5.gz /var/log/syslog.6.gz /var/log/syslog.7.gz

grep: /var/log/fsck: Is a directory

/var/log/kern.log:Feb 27 06:45:26 weather_bridge kernel: [1878102.859209] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name

/var/log/messages:Feb 27 06:45:26 weather_bridge kernel: [1878102.859209] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name

grep: /var/log/ntpstats: Is a directory

grep: /var/log/samba: Is a directory

/var/log/syslog:Feb 27 06:45:26 weather_bridge kernel: [1878102.859209] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name

root@weather_bridge:~# 


Log Before and After crash.


Feb 27 06:44:17 weather_bridge rsyslogd: [origin software="rsyslogd" swVersion="8.4.2" x-pid="390" x-info="http://www.rsyslog.com"] rsyslogd was HUPed

Feb 27 06:44:19 weather_bridge rsyslogd0: action 'action 17' resumed (module 'builtin:ompipe') [try http://www.rsyslog.com/e/0 ]

Feb 27 06:44:20 weather_bridge rsyslogd-2359: action 'action 17' resumed (module 'builtin:ompipe') [try http://www.rsyslog.com/e/2359 ]

Feb 27 06:45:25 weather_bridge kernel: [1878102.857984] mandb invoked oom-killer: gfp_mask=0x26084c0, order=0, oom_score_adj=0

Feb 27 06:45:25 weather_bridge kernel: [1878102.858072] mandb cpuset=/ mems_allowed=0

Feb 27 06:45:25 weather_bridge kernel: [1878102.858118] CPU: 0 PID: 26272 Comm: mandb Not tainted 4.4.34+ #930

Feb 27 06:45:25 weather_bridge kernel: [1878102.858181] Hardware name: BCM2708

Feb 27 06:45:25 weather_bridge kernel: [1878102.858263] [<c0016cfc>] (unwind_backtrace) from [<c0013c20>] (show_stack+0x20/0x24)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858337] [<c0013c20>] (show_stack) from [<c02e437c>] (dump_stack+0x20/0x28)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858382] [<c02e437c>] (dump_stack) from [<c012a3e4>] (dump_header+0x60/0x18c)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858428] [<c012a3e4>] (dump_header) from [<c00dcd10>] (oom_kill_process+0x2b8/0x408)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858460] [<c00dcd10>] (oom_kill_process) from [<c00dd1a4>] (out_of_memory+0x2cc/0x324)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858494] [<c00dd1a4>] (out_of_memory) from [<c00e210c>] (__alloc_pages_nodemask+0xa14/0xa8c)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858526] [<c00e210c>] (__alloc_pages_nodemask) from [<c010355c>] (__pte_alloc+0x30/0x1b4)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858555] [<c010355c>] (__pte_alloc) from [<c0105c48>] (handle_mm_fault+0x654/0xf04)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858592] [<c0105c48>] (handle_mm_fault) from [<c05765a4>] (do_page_fault+0x340/0x3c4)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858621] [<c05765a4>] (do_page_fault) from [<c05766d4>] (do_translation_fault+0xac/0xb4)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858651] [<c05766d4>] (do_translation_fault) from [<c0009204>] (do_DataAbort+0x44/0xc4)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858678] [<c0009204>] (do_DataAbort) from [<c0575ecc>] (__dabt_usr+0x4c/0x60)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858695] Exception stack(0xc0c0dfb0 to 0xc0c0dff8)

Feb 27 06:45:25 weather_bridge kernel: [1878102.858715] dfa0:                                     00000000 00022000 00000003 b6600000

Feb 27 06:45:25 weather_bridge kernel: [1878102.858739] dfc0: b6500000 00022000 00000000 b6e5a6f8 b6b00040 00001000 b68ffc68 b6800000

Feb 27 06:45:25 weather_bridge kernel: [1878102.858760] dfe0: 00000000 bec25828 b6d8af98 b6d8af9c 60000010 ffffffff

Feb 27 06:45:25 weather_bridge kernel: [1878102.858772] Mem-Info:

Feb 27 06:45:25 weather_bridge kernel: [1878102.858805] active_anon:50169 inactive_anon:50230 isolated_anon:0

Feb 27 06:45:26 weather_bridge kernel: [1878102.858805]  active_file:22 inactive_file:25 isolated_file:0

Feb 27 06:45:26 weather_bridge kernel: [1878102.858805]  unevictable:0 dirty:20 writeback:0 unstable:0

Feb 27 06:45:26 weather_bridge kernel: [1878102.858805]  slab_reclaimable:869 slab_unreclaimable:1265

Feb 27 06:45:26 weather_bridge kernel: [1878102.858805]  mapped:428 shmem:5433 pagetables:474 bounce:0

Feb 27 06:45:26 weather_bridge kernel: [1878102.858805]  free:5923 free_pcp:0 free_cma:933

Feb 27 06:45:26 weather_bridge kernel: [1878102.858879] Normal free:23692kB min:16384kB low:20480kB high:24576kB active_anon:200676kB inactive_anon:200920kB active_file:88kB inactive_file:100kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:458752kB managed:445088kB mlocked:0kB dirty:80kB writeback:0kB mapped:1712kB shmem:21732kB slab_reclaimable:3476kB slab_unreclaimable:5060kB kernel_stack:1232kB pagetables:1896kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:3732kB writeback_tmp:0kB pages_scanned:1128 all_unreclaimable? yes

Feb 27 06:45:26 weather_bridge kernel: [1878102.858900] lowmem_reserve[]: 0 0

Feb 27 06:45:26 weather_bridge kernel: [1878102.858919] Normal: 443*4kB (UMEHC) 218*8kB (UMEHC) 89*16kB (UMEHC) 70*32kB (UMEHC) 24*64kB (UMEC) 15*128kB (UMEHC) 3*256kB (MEC) 2*512kB (ME) 3*1024kB (UEC) 4*2048kB (UEC) 0*4096kB = 23692kB

Feb 27 06:45:26 weather_bridge kernel: [1878102.859060] 5554 total pagecache pages

Feb 27 06:45:26 weather_bridge kernel: [1878102.859081] 74 pages in swap cache

Feb 27 06:45:26 weather_bridge kernel: [1878102.859096] Swap cache stats: add 1615829, delete 1615755, find 759433/1173535

Feb 27 06:45:26 weather_bridge kernel: [1878102.859107] Free swap  = 0kB

Feb 27 06:45:26 weather_bridge kernel: [1878102.859117] Total swap = 102396kB

Feb 27 06:45:26 weather_bridge kernel: [1878102.859130] 114688 pages RAM

Feb 27 06:45:26 weather_bridge kernel: [1878102.859172] 0 pages HighMem/MovableOnly

Feb 27 06:45:26 weather_bridge kernel: [1878102.859187] 3416 pages reserved

Feb 27 06:45:26 weather_bridge kernel: [1878102.859197] 2048 pages cma reserved

Feb 27 06:45:26 weather_bridge kernel: [1878102.859209] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name

Feb 27 06:45:26 weather_bridge kernel: [1878102.859282] [  112]     0   112     2026      455       9       0       29             0 systemd-journal

Feb 27 06:45:26 weather_bridge kernel: [1878102.859309] [  114]     0   114     2853        0       7       0       97         -1000 systemd-udevd

Feb 27 06:45:26 weather_bridge kernel: [1878102.859331] [  340]     0   340      958       11       5       0       39             0 cron

Feb 27 06:45:26 weather_bridge kernel: [1878102.859353] [  341]     0   341      847       21       6       0       30             0 systemd-logind

Feb 27 06:45:26 weather_bridge kernel: [1878102.859377] [  348]   105   348      999       63       6       0       34             0 avahi-daemon

Feb 27 06:45:26 weather_bridge kernel: [1878102.859432] [  352]   104   352     1370       31       6       0       53          -900 dbus-daemon

Feb 27 06:45:26 weather_bridge kernel: [1878102.859628] [  362]   105   362      966        0       6       0       55             0 avahi-daemon

Feb 27 06:45:26 weather_bridge kernel: [1878102.859654] [  379] 65534   379      570        4       5       0       26             0 thd

Feb 27 06:45:26 weather_bridge kernel: [1878102.859676] [  390]     0   390     7810      113      10       0      138             0 rsyslogd

Feb 27 06:45:26 weather_bridge kernel: [1878102.859698] [  472]     0   472   139066    90779     254       0    23863             0 python

Feb 27 06:45:26 weather_bridge kernel: [1878102.859720] [  561]     0   561      638       33       5       0       29             0 dhcpcd

Feb 27 06:45:26 weather_bridge kernel: [1878102.859741] [  562]     0   562     1964        0       8       0      114         -1000 sshd

Feb 27 06:45:26 weather_bridge kernel: [1878102.859764] [  590]   106   590     1441       45       6       0       66             0 ntpd

Feb 27 06:45:26 weather_bridge kernel: [1878102.859786] [  601]     0   601      703        0       5       0       31             0 agetty

Feb 27 06:45:26 weather_bridge kernel: [1878102.859807] [  602]     0   602      658        0       5       0       31             0 agetty

Feb 27 06:45:26 weather_bridge kernel: [1878102.859829] [  608]     0   608     1803      223       8       0       46             0 apache2

Feb 27 06:45:26 weather_bridge kernel: [1878102.859850] [25045]    33 25045    57747      406      36       0       50             0 apache2

Feb 27 06:45:26 weather_bridge kernel: [1878102.859872] [25046]    33 25046    57755      406      36       0       45             0 apache2

Feb 27 06:45:26 weather_bridge kernel: [1878102.859896] [26096]     0 26096     1158       64       5       0        5             0 cron

Feb 27 06:45:26 weather_bridge kernel: [1878102.859918] [26101]     0 26101      475       19       4       0        0             0 sh

Feb 27 06:45:26 weather_bridge kernel: [1878102.859940] [26102]     0 26102      452       22       4       0        0             0 run-parts

Feb 27 06:45:26 weather_bridge kernel: [1878102.859962] [26194]     0 26194      475       35       5       0        0             0 apache2

Feb 27 06:45:26 weather_bridge kernel: [1878102.859984] [26232]     0 26232      475       21       4       0        0             0 apache2ctl

Feb 27 06:45:26 weather_bridge kernel: [1878102.860007] [26256]     0 26256     1562      179       7       0        0             0 apache2

Feb 27 06:45:26 weather_bridge kernel: [1878102.860076] [26269]     0 26269      475       18       5       0        0             0 man-db

Feb 27 06:45:26 weather_bridge kernel: [1878102.860100] [26272]     6 26272     3606     2582      10       0        0             0 mandb

Feb 27 06:45:26 weather_bridge kernel: [1878102.860119] Out of memory: Kill process 472 (python) score 814 or sacrifice child

Feb 27 06:45:26 weather_bridge kernel: [1878102.860239] Killed process 472 (python) total-vm:556264kB, anon-rss:363116kB, file-rss:0kB

Feb 27 06:45:27 weather_bridge apache2[26194]: Reloading web server: apache2.

Feb 27 06:45:27 weather_bridge CRON[26096]: (CRON) info (No MTA installed, discarding output)

Feb 27 07:17:01 weather_bridge CRON[26350]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Feb 27 08:17:01 weather_bridge CRON[26366]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Feb 27 09:17:01 weather_bridge CRON[26382]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Feb 27 10:17:01 weather_bridge CRON[26398]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Feb 27 11:07:42 weather_bridge systemd[1]: Stopping LSB: weewx weather system...

Feb 27 11:07:43 weather_bridge weewx[26463]: Stopping weewx weather system: weewx not running....

Feb 27 11:07:43 weather_bridge systemd[1]: Stopped LSB: weewx weather system.

Feb 27 11:07:47 weather_bridge systemd[1]: Starting LSB: weewx weather system...

Feb 27 11:07:48 weather_bridge weewx[26520]: engine: Initializing weewx version 3.6.2

Feb 27 11:07:48 weather_bridge weewx[26520]: engine: Using Python 2.7.9 (default, Sep 17 2016, 20:26:04) #012[GCC 4.9.2]

Feb 27 11:07:48 weather_bridge weewx[26520]: engine: Platform Linux-4.4.34+-armv6l-with-debian-8.0

Feb 27 11:07:48 weather_bridge weewx[26520]: engine: pid file is /var/run/weewx.pid

Feb 27 11:07:49 weather_bridge weewx[26510]: Starting weewx weather system: weewx.

Feb 27 11:07:49 weather_bridge systemd[1]: Started LSB: weewx weather system.

Feb 27 11:07:49 weather_bridge weewx[26524]: engine: Using configuration file /etc/weewx/weewx.conf

Feb 27 11:07:49 weather_bridge weewx[26524]: engine: Loading station type Ultimeter (weewx.drivers.ultimeter)

Feb 27 11:07:49 weather_bridge weewx[26524]: ultimeter: driver version is 0.16

Feb 27 11:07:49 weather_bridge weewx[26524]: ultimeter: using serial port /dev/ttyUSB0

Feb 27 11:07:49 weather_bridge weewx[26524]: engine: StdConvert target unit is 0x1

mwall

unread,
Feb 27, 2017, 1:20:32 PM2/27/17
to weewx-user
On Monday, February 27, 2017 at 1:02:30 PM UTC-5, Francisco Puig wrote:

@mwall , here is the logs. The last log is the Before and after the memory crash issue. I hope to find the reason, could be a memory leak in some place. I manually restarted the service at Feb 27 11:07:43.



francesco,

i need to see more of the weewx log output - from the time it starts until after two or three archive records have been saved to database.

m

Francisco Puig

unread,
Feb 27, 2017, 1:33:20 PM2/27/17
to weewx-user
I just sent the logs from the last 24hrs before and after the crash. 

Thanks in advance for the help.

mwall

unread,
Feb 27, 2017, 6:01:46 PM2/27/17
to weewx-user
On Monday, February 27, 2017 at 1:33:20 PM UTC-5, Francisco Puig wrote:
I just sent the logs from the last 24hrs before and after the crash. 

francisco,

how much memory is in the pi?

you are generating only the Standard report.  your reports take 20 to 80 seconds to run.  this is slow, but fairly normal for a rpi, and not a problem since your archive interval is 300 seconds.

you are publishing to PWSWeather, WeatherCloud, WeatherBug, WOW, and AWEKAS.

you are using a sqlite database, not mysql.

the memory use of weewx was 149066/90779 VSZ/RSS just before it was killed.

the system has no swap.

so all of this is normal.

the system probably decided to kill weewx because weewx has the biggest total_vm (VSZ), even though weewx is not doing anything unusual.

at 06:33:06 the kernel started having problems.  just before that, apache was reloaded and failed.

at 06:45:26 the kernel killed weewx (pid 472)

after the kernel killed weewx, systemd started apache again.  this time it was successful.

my guess is that apache was eating up memory, the system tried to restart it, that failed, then the system killed weewx.

try disabling apache and use nginx or lighttpd instead.  or, if this is a 512M or 256M pi, get rid of the display and disable all video/graphics, and connect using ssh.

m

mwall

unread,
Feb 27, 2017, 6:08:36 PM2/27/17
to weewx-user
On Monday, February 27, 2017 at 6:01:46 PM UTC-5, mwall wrote:
the memory use of weewx was 149066/90779 VSZ/RSS just before it was killed.

btw, typical memory use for weewx is 12000-50000 for RSS and 120000-250000 for VSZ

so your 90779 is a bit high (probably due to the 5 uploaders?), but not crazy high.

m

sorry for the reply to my own post

Francisco Puig

unread,
Feb 27, 2017, 10:41:47 PM2/27/17
to weewx-user
@mwall,

Thanks a lot for your analysis. I'm running an RPi B = 512 MB of RAM, if the issue show up again I can swap it for a RPi 3 that has 1GB of RAM and better CPU, maybe is overkill but I really like how weewx works. I will do some tests to see what happen.


On Monday, February 27, 2017 at 6:01:46 PM UTC-5, mwall wrote:

vince

unread,
Feb 28, 2017, 10:50:50 AM2/28/17
to weewx-user
On Monday, February 27, 2017 at 7:41:47 PM UTC-8, Francisco Puig wrote:
@mwall,

Thanks a lot for your analysis. I'm running an RPi B = 512 MB of RAM, if the issue show up again I can swap it for a RPi 3 that has 1GB of RAM and better CPU, maybe is overkill but I really like how weewx works. I will do some tests to see what happen.



I run weewx on a computer with 128MB RAM, if that helps any.

One thing to watch for is the forecast extension, which can use a 'lot' of memory (or it did for me), but weewx plus a couple skins is very light typically.

Louis De Lange

unread,
Feb 28, 2017, 10:59:03 AM2/28/17
to weewx-user


On Tuesday, 28 February 2017 07:50:50 UTC-8, vince wrote:

I run weewx on a computer with 128MB RAM, if that helps any.

One thing to watch for is the forecast extension, which can use a 'lot' of memory (or it did for me), but weewx plus a couple skins is very light typically.

I second that - I run weewx (with forecasting module) on an ARM5 processor with 128MB memory and weewx uses less than 50% of the available memory.  

vince

unread,
Feb 28, 2017, 11:11:06 AM2/28/17
to weewx-user


On an unrelated note, the new Pi Zero W looks pretty great, they added wifi+bluetooth.  Just ordered one at PiHut including the pretty cool ZeroView mount that sticks to a window with suction cups.  That'll make a nice timelapse weather camera or birdhouse camera setup....

Only 5 GBP shipping to the US, far cheaper/faster than waiting for Adafruit to get them in stock and then charge $10+ for shipping a half-ounce card.
 
Reply all
Reply to author
Forward
0 new messages