Thanks for the information about where the setting is for when garbage collection kicks it, I will try reducing it if 4.9.1 hasn’t fixed things. It seems better, but still too early to tell, I won’t know for sure until probably Friday unless it runs out of memory again sooner.
My DVR is great at 24/7 HD recording and pretty useless for everything else. My “snapshots” come in bursts of about 15/second for typically 10-30 seconds and then typically several minutes of no images. Largest size is typically 160-180K/per image on in bright light, typically 70-90K/image at night under IR, at night there are few false PIR activation, usually not really false since when I looked at the 24/7 record its always seemed to be a neighborhood dog, cat, raccoon, etc. that triggered it.
I won’t delve into the boring details but I’ve PIR motion detectors covering the the camera field of views and “trigger” the snapshots when a PIR goes active. Unfortunately its all or nothing from the DVR so so my filter is discarding all the images that are not from cameras covering that PIR which is most of them since its quite rare for multiple PIR to be active unless someone is actually walking from one field of view to the other (they overlap by design). But since all the cameras are looking at outdoor scenes I get bursts of false PIR activations – on the west and east sides as the sun rises and sets, on the north and south sides as the sun passes directly overhead and the whole thing is made worse by days like today with bright sun, and fast moving clouds.
So I’m hitting a peak of activity now where I get false PIR activation every 4-20 minutes and node-red is still below 20% memory usage. This time yesterday it was over 80% and ran out of memory a few hours later.
I do want to compliment the node-red developers as I find the default behaviors very well thought out and despite the fact node-red has been dying every 30-36 hours it took me a few days to realize it because of the auto restart. I was actually adding another flow to monitor “will” messages from the MQTT broker that was sending the PIR states, otherwise I might have remained blissfully unaware that node-red was dying periodically.
So far since midnight, 642 images have been sent to the AI by my filter with two detections (when my wife left for work this morning) This means probably over 2500 images have passed through my flow with over 1800 discarded.
As I said I will try 6.x if this is still “leaking” and will upgrade to 8.x or 10.x as soon as node-red-contrib-ftp-server is fixed or I can find a replacement. From looking at the node-red-contrib-ftp-server github source it looks like the issue is in the require() statement of the nodejs libraries he used:
var _ = require(‘lodash’),
FtpServer = require(‘ftpd’).FtpServer,
ip = require(‘ip’),
path = require(‘path’),
memfs = require(‘memfs’);
If anyone cares, I’ve put a simplified version of my Python Movidius AI detection script and node-red flow with all the ugliness to deal with my FLIR/Lorex DVR ripped out, up on github:
But be aware my instructions and wiki are a mess at the moment as I’ve not yet got the hang of github markup.