When I moved my Node apps over to Opalstack, I was having some issues with the apps failing, getting a 502 error. My account has 1GB of RAM, and I saw my Feed News Archive app reaching 700-800 Mb before quitting. After some Claude sessions and good old fashioned searching, I found the –max-old-space-size parameter to use in Node commands. As an example:
node –max-old-space-size=128 river5.js
The value used in the parameter is in megabytes (MB). For the Feed News Archive app, I set the size to 256. With those limits, I have not seen any 502 errors/app quitting – yay!