When I go to deploy my Dash app on Heroku I’ve been getting either an R15 or R14 error i.e. memory usage is too high.
I try to diagnose the problem locally using the dash diagnostics and I can see one page’s callbacks will take 3.2s to run and at most a different page will transfer 2.7MB of data. This hardly seems enough to cause a spike in memory usage over the 512MB limit Heroku offers.
I’ve tried using scattergl plots instead of scatter as per the dash documentation, I’ve tried to use some sort of garbage collection but couldn’t get it to work.
I’ve uploaded multi-page dash apps to Heroku before without a problem and my current one is any more complicated than they were.
I’m aware one option would be to use a memory profiler but from my understanding, I would need to test this on every function in my application which would take a very long time.
Does anyone have any advice on how to diagnose dash applications on how to find memory leaks please? I’d like to locate where the problem is coming from.