Managing memory usage for Node.js apps

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!

Node.js resources and other things

Freshman.tech – How to build your first website with Express and Pug

Codeburst.io – How to build a Node Weather App with 16 Lines of Code (Part 1)

Codeburst.io – Build a Weather Website in 30 minutes with Node, Express, and Open Weather

Codeburst.io – Three courses for learning Node.io

Codeburst.io – Learn Javascript by building a game

Codeburst.io – AI in the browser

Infinite Red Academy – AI Demystified – free 5 day course