The app exceeded the memory limit - not sure if I'm doing anything wrong

App is valley-waxflower

This is a project built using stenciljs. I’m using their integrated dev-server pointed at :3000, but every time the app builds and serves it runs out of memory. It’s possible that the stencil dev server just uses too much memory for glitch, but I wanted to check here to make sure I wasn’t doing anything silly. Any advice would be appreciated. Thanks!

Running a dev server (that detects file changes and compiles the changed files on the fly, be it stenciljs, browserify or whatever) on Glitch isn’t a good idea in general. A dev server constantly uses CPU and lots of memory, while Glitch has very low limits for both (and doesn’t offer any upgrade options for now).

One solution is to set up your project to not use a dev-server, and build everything from scratch. Another is to work with your code mainly on your local machine and push your code to Glitch periodically (probably via Github).

1 Like

I figured that was the case. I’ve reconfigured my project to create a production build and serve files statically with a node server instead. Unfortunately, the build process still maxes out the memory on glitch. Am I just hosed? Working on a local machine and then pushing code to glitch sort of defeats the purpose of it for me. Is this usually a problem with build tooling (webpack, rollup, browserify), or is stencil unusually heavyweight?

I haven’t used stencil so I can’t exactly tell. Btw, using rollup/browserify to pack a huge library code can max out the memory (and the process was actually killed by Glitch). In my case, I configured rollup to treat the library as external, so that it can be loaded separately from CDN.

If you just want to keep things online and don’t mind using multiple services, check out Gitpod - they have containers powerful enough to run a dev server, but a container is turned off if there’s no coding activity for ~30 mins.

Hello @mure! I don’t have experience with stenciljs so I’m not sure what, if any, performance modifications are available. I do know that Glitch’s memory limits are, well, limited.

This is something we’re thinking about as the Glitch team; I’ll pass along this feedback that stenciljs doesn’t work with Glitch as another thing to think about with regards to memory limits.

1 Like