node-red IBM Watson IoT Install failure
I have node-RED installed on an Omega2+ with and SD card to provide more project space with a /overlay extension.
I run the command from John Walicki's github page:
node --max_old_space_size=512 $(which npm) -g install node-red-contrib-ibm-watson-iot
and after some time I get a process out of memory error:
root@Omega-FDDF:~# node --max_old_space_size=512 $(which npm) -g install node-red-contrib-ibm-watson-iot
[ ......] \ extract:mqtt: sill pacote mqtt@https://registry.npmjs.org/mqtt/-/mqtt-2.18.8.tgz extracted in 450147ms
<--- Last few GCs --->
[2107:0x12cb000] 406292 ms: Scavenge 19.4 (23.2) -> 18.5 (23.2) MB, 10.0 / 0.1 ms allocation failure
[2107:0x12cb000] 413421 ms: Scavenge 19.4 (23.2) -> 18.5 (23.2) MB, 2402.5 / 25.9 ms allocation failure
[2107:0x12cb000] 470638 ms: Scavenge 19.4 (23.2) -> 18.5 (23.2) MB, 1737.2 / 20.2 ms allocation failure
[2107:0x12cb000] 504688 ms: Scavenge 19.5 (23.2) -> 18.6 (23.2) MB, 1563.9 / 6.5 ms allocation failure
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x53c1330d <JSObject>
1: bind(this=0x356c6561 <JSFunction onceWrapper (sfi = 0x53c41b1d)>)
2: _onceWrap(aka _onceWrap) [events.js:332] [bytecode=0x36ec7ce1 offset=42](this=0x53c04125 <undefined>,target=0x5d7ff891 <WriteStream map = 0x51e93359>,type=0x53c693a1 <String: open>,listener=0x5d7fffa1 <JSFunction (sfi = 0x4c169eed)>)
3: once [events.js:341] [bytecode=0x36ec7b75 offset=46](this=0x5d7ff891 <WriteStr...
FATAL ERROR: Committing semi space failed. Allocation failed - process out of memory
I tried other values for max_old_space_size but I get the same error but at a different point in the installation sequence.
I am using firmware 0.3.2 b222 when I try this.
I recall that I might have succeeded with this installation when I was at build b218 but that may have been for an Omega 2 Pro that I was experimenting with at the time.
I have posted an issue about this on John Walicki's github page where he has posted the Omega node-RED flows but have not seen a reply yet.
@James-Solderitsch do you think having a swapfile might help?
@Douglas-Kryder It might. How do I enable? I have an SD card with 8GBs that I am using to extend the /overlay space. Can I also place a swap file on the SD card?
@James-Solderitsch I did find this:
Seems to provide for both a partition for swap AND a partition for extending /overlay.
Will try this later today and see how far I get.
@James-Solderitsch After I followed the instructions at the link I posted above to provide both a swap partition AND a file-space partition, I was able to complete the install of the IBM Watson-IoT nodes as documented on John Walicki's github page.
So it looks like have a swap partition is mandatory for the Omega2+. Perhaps not needed for the Omega Pro..
@James-Solderitsch John Walicki has added some notes to his node-RED github page about installing node-RED on an Omega2+. He also advocates for the need to have a swap partition AND an extended file system to have room to install and run node-RED on an Omega2+.