“The app exceeded the memory limit” - 300%+ memory. cannot kill with refresh

my glitch is here: https://glitch.com/edit/#!/swyx-redux-tetris-fcc?path=src/components/Game.jsx:13:24

i think the user experience when i hit a memory issue is very poor. i installed react-sound and uploaded a 2mb file and i dont expect to have a sudden spike in memory usage to 1605MB which is what the console is showing me (fwiw i know heavy node_modules is a meme but i dont think that’s relevant here)

even if memory overload happens, i would expect to be able to kill and restart the process. i googled and found many instances of this and the solution seems to be to type refresh. i did, it didn’t work, now i have no remaining options for using glitch.

here is the result of ps aux


app@swyx-redux-tetris-fcc:~ 06:52 
$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  19716  3100 ?        Ss   04:00   0:00 bash /usr/bin/start-container
root         6  0.0  0.0   4392  1148 ?        S    04:00   0:00 runsvdir -P /etc/service
root         7  0.0  0.0   4240   800 ?        Ss   04:00   0:00 runsv watcher
root         8  0.0  0.0   4240   652 ?        Ss   04:00   0:00 runsv wetty
root         9  0.0  0.0    212     4 ?        S    04:00   0:00 /usr/bin/dumb-init /bin/bash ./run
root        10  0.0  0.0    212     4 ?        S    04:00   0:00 /usr/bin/dumb-init /bin/bash ./run
root        11  0.0  0.0  19700  3112 ?        Ss   04:00   0:00 /bin/bash ./run
root        12  0.0  1.1 915840 70464 ?        Sl   04:00   0:38 node build/source/index.js
root        13  0.0  0.0  19700  3172 ?        Ss   04:00   0:00 /bin/bash ./run
root        20  0.0  0.0   4504   792 ?        S    04:00   0:00 /bin/sh /opt/nvm/versions/node/v10/bin/wetty --port 1084 --command /etc/service/we
root        26  0.0  0.8 782152 50512 ?        Sl   04:00   0:01 /opt/nvm/versions/node/v10/bin/node /opt/nvm/versions/node/v10/bin/../pnpm-global/
app         33  0.0  0.6 600240 43240 ?        Sl   04:00   0:00 /opt/nvm/versions/node/v10.15.3/bin/node /opt/watcher/build/source/webdav.js
app       8441  0.0  0.0   4504   784 ?        SN   05:45   0:00 /bin/sh /app/node_modules/.bin/react-scripts start
app       8447  0.0  0.5 560616 32796 ?        SNl  05:45   0:00 node /app/node_modules/.bin/../../../rbd/pnpm-volume/1f0ae436-c65f-45c8-968c-328ca
app       8458  0.0 25.8 2699956 1625116 ?     SNl  05:45   8:08 node /rbd/pnpm-volume/1f0ae436-c65f-45c8-968c-328cae74de17/node_modules/.registry.
app       9893  0.0  0.0  20124  3680 ?        SNs  06:40   0:00 bash /opt/watcher/app-types/node/start.sh
root      9995  0.0  0.0  19720  3216 pts/2    Ss   06:43   0:00 /bin/bash /etc/service/wetty/wetty-command.sh
root     10000  0.0  0.0  51004  3324 pts/2    S    06:43   0:00 su --preserve-environment --login app
app      10001  0.0  0.0  19956  3820 pts/2    S    06:43   0:00 -su
root     10130  0.0  0.6 864308 42696 ?        Sl   06:50   0:00 /opt/nvm/versions/node/v10.15.3/bin/node /opt/watcher/build/source/ot-storage.js /
app      10160  0.0  0.0   6008   644 ?        SN   06:55   0:00 sleep 15
app      10161  0.0  0.0  36084  3232 pts/2    R+   06:55   0:00 ps aux

nothing immediately obvious causing it.

here is the console disagreeing, telling me some memory thing is going on

sorry i dont know how to be constructive here. i know i can resolve it by forking and carrying on. but presumably y’all want to have reproducible cases of this issue so you can figure this out.

Try running killall node in the console as that will kill all running node processes.

Hey @swyx I agree that the experience here isn’t as good as it could be. @charliea21’s suggestion is a good one for forcing your project to restart its Node processes.

For whatever it’s worth, I’m pretty sure your ps aux output does actually point to the problem, but the %MEM value is the value relative to the host, not the container, whereas the values in the Container Stats show the container-specific levels. The process that’s running 25.8% memory ends up being around 1500 Mb of memory, which is pretty close to what your Container Stats show.

I wasn’t able to reproduce your experience either in your project or in a remix, though - even after restarting a Remix of your project several times I never cam anywhere close to the memory levels you were seeing. Is there anything more you can tell me about what was going on that might help me reproduce it?

yes, as i wrote above, everything was working fine until i installed react-sound and uploaded a 2mb file and tried to use it in my project. then this started happening. i then tried to remove it.

now my app doesnt work. “Starting inspector on localhost:9200 failed: address not available”

Hey @swyx it’s likely that you’ve got the debugger on and it’s not properly started. I suggest you turn that off using the Ladybug/Stop Sign :stop_sign:button above the Logs pane. You can then decide if you want to turn it back on or not.