Every time a python plugin encounters an error, domoticz seems to lose a lot of memory. Since disabling the plugin isn't always an immediate option and since plugins are difficult to programme completely bug free, is there any way whereby the plugin framework can be made a bit more resilient in terms of memory?
H
Python plugin memory management
Moderator: leecollings
- heggink
- Posts: 994
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Python plugin memory management
Docker in Truenas scale, close to latest beta
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
- heggink
- Posts: 994
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: Python plugin memory management
@Dnpwwo?
Docker in Truenas scale, close to latest beta
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
- Dnpwwo
- Posts: 820
- Joined: Sunday 23 March 2014 9:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Melbourne, Australia
- Contact:
Re: Python plugin memory management
I haven't seen this.
Do you have a sample script that throws an error and loses memory?
Do you have a sample script that throws an error and loses memory?
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
- heggink
- Posts: 994
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: Python plugin memory management
The script that caused it last time was the life360 script. At that point, it still used the google maps api that google has just decommissioned. It got buggered up every time I would cross the atlantic (with google unable to find a route for me and the plugin raising an (unexpected) python error. Once I got to the other side of the pond, my memory was close to gone with Domoticz eating it all.
I still have the original script and can send it if you wish. Should be easy to fake a google error again.
I still have the original script and can send it if you wish. Should be easy to fake a google error again.
Docker in Truenas scale, close to latest beta
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
- heggink
- Posts: 994
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: Python plugin memory management
@dnpwwo: just found another example: in the heartbeat of my own iCloud plugin, I did not check for any errors raised by the pyicloud library (PyiCloudFailedLoginException). Last 24 hours, it failed a bunch of times resulting in the domoticz process jumping from 20ish% mem usage to over 50% usage in less than a day. The below was the only error and domoticz memory had been stable for 5 days. I am on version 10171 (about a month old).
domoticz log:
Dec 5 19:07:27 domoticz domoticz: (XXXX) 'onHeartbeat' failed 'PyiCloudFailedLoginException'.
Dec 5 19:07:27 domoticz domoticz: (XXXX) ----> Line 261 in '/home/pi/domoticz/plugins/iCloud/plugin.py', function onHeartbeat
Dec 5 19:07:27 domoticz domoticz: (XXXX) ----> Line 141 in '/home/pi/domoticz/plugins/iCloud/plugin.py', function onHeartbeat
Dec 5 19:07:27 domoticz domoticz: (XXXX) ----> Line 192 in '/usr/lib/python3.5/pyicloud/base.py', function __init__
Dec 5 19:07:27 domoticz domoticz: (XXXX) ----> Line 215 in '/usr/lib/python3.5/pyicloud/base.py', function authenticate
there were 616 of these errors in total.
domoticz log:
Dec 5 19:07:27 domoticz domoticz: (XXXX) 'onHeartbeat' failed 'PyiCloudFailedLoginException'.
Dec 5 19:07:27 domoticz domoticz: (XXXX) ----> Line 261 in '/home/pi/domoticz/plugins/iCloud/plugin.py', function onHeartbeat
Dec 5 19:07:27 domoticz domoticz: (XXXX) ----> Line 141 in '/home/pi/domoticz/plugins/iCloud/plugin.py', function onHeartbeat
Dec 5 19:07:27 domoticz domoticz: (XXXX) ----> Line 192 in '/usr/lib/python3.5/pyicloud/base.py', function __init__
Dec 5 19:07:27 domoticz domoticz: (XXXX) ----> Line 215 in '/usr/lib/python3.5/pyicloud/base.py', function authenticate
there were 616 of these errors in total.
Docker in Truenas scale, close to latest beta
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel