Node-Red on Omega2+: Segfault on low memory even /w swap active



  • @Theodore-Borromeo That is actually untrue. Swapping is per-page, and a program of any size to be an issue is going to have multiple code pages as well as data pages. If execution reaches a page that is not currently in memory, a page fault occurs and execution pauses while it is loaded, the same as would happen if access were attempted to a data page that was not resident in memory.

    This is important, because a large program will have portions which are rarely needed. Going a step further, it varies by implementation, but ideally the program won't even all necessarily be loaded from disk into RAM at the start, but rather portions may only be loaded as needed, even though to the process itself, it will look as if it is all there - it's just those parts won't actually be there until an attempt is made to access them.

    However swapping, especially writeable memory data to an SD scard (or even worse, the build-in SPI flash) is a poor solution. Likely the task is either being done with unnecessary inefficiency, or the wrong platform has been selected, or both.



  • @Chris-Stratton That how I have always understood the use of SWAP by the OS. I can report however that starting node red with:

    node --max-old-space-size=56 red.js

    Has now kept it up for several hours of playing. The 56 was picked by looking at the output of free

    With regards to picking the wrong platform for what I'm trying to do. Completely possible :-)
    I had not heard of Node Red until a few days ago. I'm trying see if can use the Omega2+ as a cheap sensor platform that can:

    • Interaction with sensors for temp, humidity, voltage, current. It seems that with I2C and ControlEverything products I can do all that
    • Report said data to a central control system for graphing etc
    • Trigger relay closures from a central control system easily
    • Operate without internet connection

    Between Node Red and MQTT it looks like I can do most of that without spending a minute in writing something custom.

    Bas



  • IMHO, more RAM is always a good thing, say 512KB or even 1MB.
    Don't know if there is a production plan and hope the price won't jump too much.

    ccs_hello



  • @Chris-Stratton I have never seen swap pushed that far, or assumed to be that efficient on any embedded system. I think, though, that you've seemed to answer the question with your suspicion on SD card performance. Have you tried class 10 cards on a 2plus? the other option is the max size command, which seems to work for some.



  • @ccs-hello said in Node-Red on Omega2+: Segfault on low memory even /w swap active:

    IMHO, more RAM is always a good thing, say 512KB or even 1MB.
    Don't know if there is a production plan and hope the price won't jump too much.

    it so happens that the smaller and larger configurations of these modules ship with 128 times the memory ranges you propose ;-)

    This is plenty to do reasonable things efficiently; but it won't be enough for software stacks that assume unlimited resources and consume them even for simple tasks.



  • I must have been sleep typing :} I meant 512MB or 1GB RAM.

    ccs_hello



  • Then you really want a fundamentally different system - the point of these is that router chips have a lot of additional usage possibilities.



  • Per MT7688AN datasheet (yes, it's an AN chip, not KN), it can support up to 256MB DDR2 RAM max.
    Currently it's using a single 16M x 16 bit/word DDR2 SDRAM.(which is equivalent to 128MB RAM.)
    A redesign can use two pieces of MT5TU128M8HE chips in parallel to get to 256MB.
    Naturally the board will be slightly longer.

    ccs_hello



  • @Bas-Rijniersce thanks .. work with me


Log in to reply