Here is my current problem.
Running Node red (3.0.2 / nodejs 18.16.0) locally on Ubuntu 18.04 LTS with 16 GB memory (Ryzen 5 machine) . Heap memory allocation is 4 GB. Started to experience reboots on node red a week ago. No new nodes were introduced at that time. InfluxDB and Grafana about week before seeing this problem.
Started node red in --safe mode an noticed couple node's were giving error so cleaned them up (node-red-contrib-arp and node-red-contrib-tradfri). Now node-red --safe opens nicely with no errors (couple warnings as some tuya devices are not yet fully online at boot). If I deploy same nodes from the safe mode everything works (all tabs and data collections and influxdb and grafana injects). If I try to open node red directly I get into the constant reboot cycle on node red.
This is taken from syslog when error / reboot occurred. When looking through Webmin the memory usage never goes above 50% when reboots happen.
Apr 17 17:51:31 SAMONE influxd-systemd-start.sh[1519]: [httpd] 127.0.0.1 - root [17/Apr/2023:17:51:31 +0300] "POST /write?db=IELEC&p=%5BREDACTED%5D&precision=n&rp=&u=root HTTP/1.1 " 204 0 "-" "-" 575bf107-dd2f-11ed-bbfa-04421a20a486 4517
Apr 17 17:51:31 SAMONE influxd-systemd-start.sh[1519]: [httpd] 127.0.0.1 - root [17/Apr/2023:17:51:31 +0300] "POST /write?db=IELEC&p=%5BREDACTED%5D&precision=n&rp=&u=root HTTP/1.1 " 204 0 "-" "-" 5777900c-dd2f-11ed-bbfb-04421a20a486 3350
Apr 17 17:51:31 SAMONE influxd-systemd-start.sh[1519]: [httpd] 127.0.0.1 - root [17/Apr/2023:17:51:31 +0300] "POST /write?db=IELEC&p=%5BREDACTED%5D&precision=n&rp=&u=root HTTP/1.1 " 204 0 "-" "-" 5777aef4-dd2f-11ed-bbfc-04421a20a486 5557
Apr 17 17:51:32 SAMONE systemd[1]: Stopping Node-RED graphical event wiring tool...
Apr 17 17:51:32 SAMONE Node-RED[178965]: <--- Last few GCs --->
Apr 17 17:51:32 SAMONE Node-RED[178965]: [178965:0x6bb43b0] 5666 ms: Scavenge 243.0 (259.5) -> 242.9 (260.5) MB, 2.4 / 0.0 ms (average mu = 0.874, current mu = 0.576) allocation failure;
Apr 17 17:51:32 SAMONE Node-RED[178965]: [178965:0x6bb43b0] 5671 ms: Scavenge 243.9 (260.5) -> 243.8 (265.5) MB, 2.2 / 0.0 ms (average mu = 0.874, current mu = 0.576) allocation failure;
Apr 17 17:51:32 SAMONE Node-RED[178965]: [178965:0x6bb43b0] 5736 ms: Mark-sweep 246.7 (265.5) -> 245.5 (269.0) MB, 43.9 / 0.0 ms (average mu = 0.790, current mu = 0.454) allocation failure; scavenge might not succeed
Apr 17 17:51:32 SAMONE Node-RED[178965]: <--- JS stacktrace --->
Apr 17 17:51:32 SAMONE Node-RED[178965]: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Apr 17 17:51:32 SAMONE Node-RED[178965]: 1: 0xb7a940 node::Abort() [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 2: 0xa8e823 [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 3: 0xd5c940 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 4: 0xd5cce7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 5: 0xf3a3e5 [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 6: 0xf4c8cd v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 7: 0xf26fce v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 8: 0xf28397 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 9: 0xf088e0 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 10: 0xf00354 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 11: 0xf026e8 v8::internal::FactoryBase<v8::internal::Factory>::NewRawTwoByteString(int, v8::internal::AllocationType) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 12: 0x1333f8c v8::internal::IncrementalStringBuilder::Extend() [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 13: 0x1048668 v8::internal::JsonStringifier::SerializeDouble(double) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 14: 0x104ee6f v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 15: 0x104eb23 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 16: 0x104c2ca v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 17: 0x104c60f v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 18: 0x104ee6f v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 19: 0x104c2ca v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 20: 0x104ee6f v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 21: 0x104eb23 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 22: 0x104fbbf v8::internal::JsonStringify(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 23: 0xde28f7 v8::internal::Builtin_JsonStringify(int, unsigned long*, v8::internal::Isolate*) [node-red]
Apr 17 17:51:32 SAMONE Node-RED[178965]: 24: 0x16fb7b9 [node-red]
Apr 17 17:51:32 SAMONE systemd[1]: nodered.service: Main process exited, code=dumped, status=6/ABRT
Apr 17 17:51:32 SAMONE systemd[1]: nodered.service: Failed with result 'core-dump'.
Apr 17 17:51:32 SAMONE systemd[1]: Stopped Node-RED graphical event wiring tool.
Any guidance how to solve? (please no remove everything and start from zero )