This is making my day crazy. I have a React.js page and a Java spring boot backend both deployed through Heroku.
My React.js was running absolutely fine till I made some display changes and some coding logic when file gets uploaded, so nothing related to memory use during display of homepage. I have Github connected to it, so last deploy was sucessful but on opening the page get "Application Error".
On checking log tails I am getting
2024-02-14T20:48:56.232065+00:00 app[web.1]: Starting the development server...
2024-02-14T20:48:56.232114+00:00 app[web.1]:
2024-02-14T20:48:56.337438+00:00 heroku[web.1]: State changed from starting to up
2024-02-14T20:49:10.263965+00:00 heroku[web.1]: Process running mem=625M(122.0%)
2024-02-14T20:49:10.266612+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2024-02-14T20:49:28.398259+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=nige-dashboard-ebe5b010ecec.herokuapp.com request_id=a83c0256-5fcb-42f8-936c-54113fecefef fwd="117.233.188.137" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
2024-02-14T20:49:28.923431+00:00 heroku[web.1]: Process running mem=783M(153.0%)
2024-02-14T20:49:28.925645+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2024-02-14T20:49:49.988472+00:00 heroku[web.1]: Process running mem=772M(150.8%)
2024-02-14T20:49:49.990602+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2024-02-14T20:49:58.778951+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=nige-dashboard-ebe5b010ecec.herokuapp.com request_id=d3d16fa7-52af-4f86-a3e0-2e77b32d7295 fwd="117.233.188.137" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0 protocol=https
2024-02-14T20:50:10.464690+00:00 heroku[web.1]: Process running mem=1362M(266.2%)
2024-02-14T20:50:10.488272+00:00 heroku[web.1]: Error R15 (Memory quota vastly exceeded)
2024-02-14T20:50:10.490961+00:00 heroku[web.1]: Stopping process with SIGKILL
2024-02-14T20:50:10.743042+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=nige-dashboard-ebe5b010ecec.herokuapp.com request_id=a449cb24-df21-4582-8e22-34a5d20f39a0 fwd="117.233.188.137" dyno=web.1 connect=0ms service=19874ms status=503 bytes=0 protocol=https
2024-02-14T20:50:10.814563+00:00 heroku[web.1]: Process exited with status 137
2024-02-14T20:50:10.851626+00:00 heroku[web.1]: State changed from up to crashed
2024-02-14T20:50:16.710021+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=nige-dashboard-ebe5b010ecec.herokuapp.com request_id=aa1e7c6f-c4fa-464e-a377-5a809414ec02 fwd="117.233.188.137" dyno=web.1 connect=5000ms service= status=503 bytes= protocol=https
I am continously getting R14 and R15 error of memory quota exceeding
Assuming I might have messed up with new code, I created a new branch on Github and used the last commit that was running ok and deployed again from heroku, still same error on project that was running fine.
I have restarted dynos, deleted project and created again but still no change.
Any help please !
PS: every commit runs perfectly locally
After much googling stumbled upon this answer
StackOverflow Answer on my issue
So in summary the issue is its deploying the complete development environment on server thereby increasing memory.
2 part solution:
Suddenly why it started behaving like this, no idea !