My app keep restarting


#1

Hello glitch peeps, today i was checking my app and i saw it keeps restarting even without exceed the 512mb of memory and it’s not the ping thing cuz i’m pinging my app with uptimerobot every 5 min…
I checked with pm2 monit and that was the result:
chrome_2018-10-14_14-56-41
But in the editor it shows:
chrome_2018-10-14_14-57-23
I can’t figure out what’s happening for that huge memory leak…
Hope someone can help-me with that.
Thanks in advance!


#2

Apps sleep after 5 minutes of inactivity, so if your intent is to keep the project awake then pinging it every 15 is insufficient.

With regard to the memory issue, the first thing to do is identify what’s using it up. You can do this by disabling one part of you project at a time, and look how ram usage changes. Follow this rule until you identified the lines of code that take up all that ram.


#3

I made a typo, Uptime Robot ping my app every 5 minutes, sorry. But about the memory issue, there is anything that could cause that. The sum of the two apps i have running is about 319mb and in the editor it shows 479mb and i don’t have any other app like redis and stuff…
I just remixed the hello-express template and as you can see, it shows the wrong value:


#4

There are lots of things that can cause it - multiple simultaneous processes, large amounts of data stored in variables, memory intensive tasks like video transcription, handling streams, compiling code like with webpack, or errors in code that cause infinite loops, setInterval() without a time frame etc. This is why we suggest stepping through the code to work out which part is causing it.

It’s not the wrong value, it’s a different value.