I used Nuxt.js to build my blog application, deployed in linux, the memory used is too high.
My server using ubuntu operating system, 1g memory, I use pm2 persistent node application.
I deploy my project every time, you can see the memory is normal, about 80m or so,
After a period of time, the memory will soar to more than 500m, the final memory overflow, resulting in server crashes,
When I found that memory usage up to 90% of the time, I kill off the nuxt process, pm2 immediately restart it, then returned to normal
I am curious, why is my memory usage going up all the time?
Here is the screenshot
Abnormal state
normal status
My solution is set the max_memory_restart: "160M"
attribute to ecosystem.config.js for pm2, the pm2 will listen the app memory, it will auto restart the app when the memory beyonds 160m, it can works, but it's not right solution.
I get the document from Nuxt.js, i try to set the nuxt.config.js cache: false
or cache:{ max: 20, maxAge: 600000 }
, but i think it does not work well.
I would like to find a better source of the problem, as well as the solution, thanks!
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c232">#c232</a>)</em></sub></div>