Theia not suitable on memory-limited environments
In memory-limited environments, this would make Theia IDE not suitable as it can usually go over the 512MB limit as I tested it meticulously (which causes OutOfMemory backoff on OpenShift).
Contrast this to a competing Node.js IDE, Cloud9, which only consumes 140-200 MB of operational backend memory and 90MB-100MB idle, Theia goes over the limit and eats from a increase to 140 idle MB and just OOMs when during operational use.
Maybe we should optimize the IDE for memory-limited environments or allow to set node GC options directly in the theia call in yarn
However there is a workaround for the memory problem:
if using the theia CLI, instead of calling theia start projectFolder/, you have to call main.js directly with your preferred GC options, something like node --expose-gc --max-old-space-size=128 --max-new-space-size=256 /home/theia/src-gen/backend/main.js projectFolder/. For electron however, we could use the node options flag to pass this.
max-new-space-size seems not to be a valid option. See https://nodejs.org/docs/latest-v16.x/api/cli.html for available cli options.