I built web app to display sensors and charts in real time. it works well, but it has memory leak problem. when i start it, it took 200M memory only. but after 10 hours, it became 2G. I tried to fix , but seems it's from chrome browser. when i close the chrome tab, memory was released. so I am finding to release memory automatically. is there anyone who know this?
I noticed there is the way to restart app when memory size exceeds max size.
pm2 start big-array.js --max-memory-restart 20M
but it will restart app. I want to run this app without any restarting or refresh browser.