michaelarnauts / cec-mqtt-bridge

A HDMI-CEC to MQTT bridge for connecting HDMI-CEC-devices to your Home Automation system.
145 stars 48 forks source link

Out of memory on r-pi 3 #10

Closed hamishfagg closed 6 years ago

hamishfagg commented 6 years ago

My r-pi kernel is killing bridge.py after a few days due to it being out of memory. Has anyone else had this issue?

Python version 3.5.3 Kernel version Linux raspberrypi 4.9.59+

In kern.log about the kill:

May  9 07:20:57 raspberrypi kernel: [584030.004827] 151 pages in swap cache                                                                                                                   
May  9 07:20:57 raspberrypi kernel: [584030.004832] Swap cache stats: add 26489, delete 26338, find 2254/2535                                                                                 
May  9 07:20:57 raspberrypi kernel: [584030.004835] Free swap  = 0kB                                                                                                                          
May  9 07:20:57 raspberrypi kernel: [584030.004838] Total swap = 102396kB                                                                                                                     
May  9 07:20:57 raspberrypi kernel: [584030.004842] 114688 pages RAM                                                                                                                          
May  9 07:20:57 raspberrypi kernel: [584030.004844] 0 pages HighMem/MovableOnly                                                                                                               
May  9 07:20:57 raspberrypi kernel: [584030.004847] 3555 pages reserved                                                                                                                       
May  9 07:20:57 raspberrypi kernel: [584030.004849] 2048 pages cma reserved                                                                                                                   
May  9 07:20:57 raspberrypi kernel: [584030.004853] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name                                                         
May  9 07:20:57 raspberrypi kernel: [584030.004889] [   91]     0    91     2404      702       8       0       59             0 systemd-journal                                              
May  9 07:20:57 raspberrypi kernel: [584030.004899] [  129]     0   129     3575       15       8       0      135         -1000 systemd-udevd                                                
May  9 07:20:57 raspberrypi kernel: [584030.004910] [  202]   100   202     4316       19       9       0       92             0 systemd-timesyn                                              
May  9 07:20:57 raspberrypi kernel: [584030.004920] [  231]     0   231     1321       13       5       0       41             0 cron                                                         
May  9 07:20:57 raspberrypi kernel: [584030.004929] [  233]   105   233     1622       45       7       0       59          -900 dbus-daemon                                                  
May  9 07:20:57 raspberrypi kernel: [584030.004939] [  236]     0   236     5712       94      11       0       80             0 rsyslogd                                                     
May  9 07:20:57 raspberrypi kernel: [584030.004948] [  240]     0   240     1842      157       7       0       73             0 systemd-logind                                               
May  9 07:20:57 raspberrypi kernel: [584030.004958] [  247] 65534   247     1321        4       6       0       57             0 thd                                                          
May  9 07:20:57 raspberrypi kernel: [584030.004967] [  256]   108   256     1596      215       7       0       61             0 avahi-daemon                                                 
May  9 07:20:57 raspberrypi kernel: [584030.004976] [  266]   108   266     1596        5       7       0       72             0 avahi-daemon                                                 
May  9 07:20:57 raspberrypi kernel: [584030.005027] [  340]     0   340     2530       79       8       0      113             0 wpa_supplicant                                               
May  9 07:20:57 raspberrypi kernel: [584030.005040] [  360]     0   360      520        0       5       0       33             0 hciattach                                                    
May  9 07:20:57 raspberrypi kernel: [584030.005051] [  365]     0   365     1766        0       7       0       75             0 bluetoothd                                                   
May  9 07:20:57 raspberrypi kernel: [584030.005060] [  421]     0   421      717       26       5       0       57             0 dhcpcd                                                       
May  9 07:20:57 raspberrypi kernel: [584030.005070] [  422]     0   422     2546        0       8       0      137         -1000 sshd                                                         
May  9 07:20:57 raspberrypi kernel: [584030.005079] [  430]   999   430     8979      245       9       0      124             0 snapclient                                                   
May  9 07:20:57 raspberrypi kernel: [584030.005089] [  435]     0   435     1045        0       6       0       34             0 agetty                                                       
May  9 07:20:57 raspberrypi kernel: [584030.005098] [  453]  1000   453     2413       51       9       0      119             0 systemd                                                      
May  9 07:20:57 raspberrypi kernel: [584030.005108] [  456]  1000   456     2821       42       8       0      270             0 (sd-pam)                                                     
May  9 07:20:57 raspberrypi kernel: [584030.005118] [  484]  1000   484     1364       35       7       0       63             0 tmux: server                                                 
May  9 07:20:57 raspberrypi kernel: [584030.005128] [  485]  1000   485     1542        0       6       0      339             0 bash                                                         
May  9 07:20:57 raspberrypi kernel: [584030.005138] [  510]  1000   510   142561    97832     257       0    23076             0 python3                                                      
May  9 07:20:57 raspberrypi kernel: [584030.005149] [ 4460]     0  4460     1694       79       6       0        8             0 cron                                                         
May  9 07:20:57 raspberrypi kernel: [584030.005159] [ 4466]     0  4466     1694       79       6       0        8             0 cron                                                         
May  9 07:20:57 raspberrypi kernel: [584030.005168] [ 4480]     0  4480      471       21       5       0        0             0 sh                                                           
May  9 07:20:57 raspberrypi kernel: [584030.005178] [ 4482]     0  4482      471       21       5       0        0             0 sh                                                           
May  9 07:20:57 raspberrypi kernel: [584030.005187] [ 4483]     0  4483      451       22       5       0        0             0 run-parts                                                    
May  9 07:20:57 raspberrypi kernel: [584030.005197] [ 4484]     0  4484      451       22       5       0        0             0 run-parts                                                    
May  9 07:20:57 raspberrypi kernel: [584030.005206] [ 4485]     0  4485     1433      170       6       0       13             0 cron                                                         
May  9 07:20:57 raspberrypi kernel: [584030.005216] [ 4486]     0  4486      471       20       4       0        0             0 fake-hwclock                                                 
May  9 07:20:57 raspberrypi kernel: [584030.005225] [ 4489]     0  4489      471       21       5       0        0             0 fake-hwclock                                                 
May  9 07:20:57 raspberrypi kernel: [584030.005235] [ 4491]     0  4491      438      145       4       0        0             0 bsdmainutils                                                 
May  9 07:20:57 raspberrypi kernel: [584030.005244] [ 4492]     0  4492      435      146       4       0        0             0 date                                                         
May  9 07:20:57 raspberrypi kernel: [584030.005250] Out of memory: Kill process 510 (python3) score 886 or sacrifice child                                                                    
May  9 07:20:57 raspberrypi kernel: [584030.005299] Killed process 510 (python3) total-vm:570244kB, anon-rss:390332kB, file-rss:996kB, shmem-rss:0kB
May  9 07:20:58 raspberrypi kernel: [584030.679268] oom_reaper: reaped process 510 (python3), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
michaelarnauts commented 6 years ago

I haven't noticed this in mine. I currently have it running for over a few months without issues.

I'm on a fully updated raspbian.

hamishfagg commented 6 years ago

Hmm ok that's werid. TBH I have rewritten parts of this bridge now using this so I will close.