I am a relatively new NR user. I have a production system running on Windows VM as well as a pilot system running on linux. Issue replicated on both systems.
I am using NR in a manufacturing environment and most nodes are interfacing with equipment/sensors, displaying series charts as well as status fields on dashboards and also logging that data to a MSSQL server in some, but not all, cases. I currently have roughly 15 flows running doing various tasks.
Generally I poll my devices every 2-10 minutes and present some of that data on time series line or scatter plots. I ran into troubles with losing my time series chart data (using a mix of Dash and Dash 2.0 chart) when I would have to restart NR. This is a problem as most charts are 24 hours and up to 2 weeks in duration. I decided to try persistent context by enabling disk storage in settings.js and storing an array of objects for approx 8 of the 15 flows, each flow having their own array.
Initially the system works fine but both my windows system as well as linux crash after a period if time. Once they crash they will not restart unless I get rid of the persistent context.
On the linux system the global.json file was fairly small:
-rw-r--r-- 1 nradmin nradmin 74274 Apr 17 08:58 global.json
and this is the log output before crash:
17 Apr 09:11:15 - [info]
Welcome to Node-RED
17 Apr 09:11:15 - [info] Node-RED version: v3.1.9
17 Apr 09:11:15 - [info] Node.js version: v18.20.2
17 Apr 09:11:15 - [info] Linux 5.15.0-102-generic x64 LE
17 Apr 09:11:15 - [info] Loading palette nodes
17 Apr 09:11:16 - [info] Dashboard version 1.0.2 started at /ui
17 Apr 09:11:16 - [info] Settings file : /home/nradmin/.node-red/settings.js
17 Apr 09:11:16 - [info] Context store : 'default' [module=localfilesystem]
17 Apr 09:11:16 - [info] User directory : /home/nradmin/.node-red
17 Apr 09:11:16 - [warn] Projects disabled : editorTheme.projects.enabled=false
17 Apr 09:11:16 - [info] Flows file : /home/nradmin/.node-red/flows.json
17 Apr 09:11:16 - [info] Server now running at http://127.0.0.1:1880/
17 Apr 09:11:16 - [info] Starting flows
17 Apr 09:11:16 - [info] [ui-base:Process Data] Node-RED Dashboard 2.0 (v1.7.1) started at /dashboard
17 Apr 09:11:16 - [info] [ui-base:Process Data] Created socket.io server bound to Node-RED port at path /dashboard/socket.io
17 Apr 09:11:16 - [warn] [modbus-client:Pit 1] Client -> fsm init state after new TCP@192.168.140.14:502 default Unit-Id: 1
17 Apr 09:11:16 - [warn] [modbus-client:Pit 1] Client -> first fsm init in 500 ms TCP@192.168.140.14:502 default Unit-Id: 1
17 Apr 09:11:16 - [info] Started flows
17 Apr 09:11:17 - [warn] [modbus-flex-sequencer:788d99cf52d5b1bc] Flex-Sequencer -> Inject while node is not ready for input.
<--- Last few GCs --->
[1382:0x6caa850] 26226 ms: Scavenge 2039.6 (2081.5) -> 2036.6 (2081.5) MB, 3.8 / 0.0 ms (average mu = 0.218, current mu = 0.193) allocation failure;
[1382:0x6caa850] 26234 ms: Scavenge 2040.1 (2081.5) -> 2037.4 (2082.5) MB, 4.0 / 0.0 ms (average mu = 0.218, current mu = 0.193) allocation failure;
[1382:0x6caa850] 26241 ms: Scavenge 2040.9 (2082.5) -> 2038.1 (2083.5) MB, 3.9 / 0.0 ms (average mu = 0.218, current mu = 0.193) allocation failure;
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb9a330 node::Abort() [node-red]
2: 0xaa07ee [node-red]
3: 0xd71ed0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node-red]
4: 0xd72277 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node-red]
5: 0xf4f635 [node-red]
6: 0xf50538 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node-red]
7: 0xf60a33 [node-red]
8: 0xf618a8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node-red]
9: 0xf64a75 v8::internal::Heap::HandleGCRequest() [node-red]
10: 0xee2bdf v8::internal::StackGuard::HandleInterrupts() [node-red]
11: 0x12e349f v8::internal::Runtime_StackGuardWithGap(int, unsigned long*, v8::internal::Isolate*) [node-red]
12: 0x1710739 [node-red]
Aborted (core dumped)
My question is am I using the persistent context improperly? Is there a size limitation? Rate limitation? I could possibly use my sql system for this but in some cases I do not actually need to log the data to sql, just need the visual history.
Thanks for help in advance.