My node worker is running out of memory on Heroku and my Heroku worker is restarting itself in the middle of processing a message in the queue. When I run the same exact code on my localhost (on macbook) memory is reclaimed and it never goes above 120mb or so.
What could be possible reason for this out of memory error on production environment ? Do we need to handle memory managment in Heroku ? Is there something about Heroku that I don't know regarding memory ?