✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
📊 Dash 2.0 is Arriving. Register here.

Heroku R14 Memory Quoted Exceeded Error

I’m deploying a dash app and getting R14 memory quota exceeeded.

My app keeps a 40Meg json file in memory and generates graphs with 70,000 points.

It runs fine on my laptop.
How do I get the memory I need?

Update: I have purchased a 2x dyno (1024M membory) and my app does now run without crashing.

But I do keep getting R14 memory quota exceeded errors.

I’d appreciate some suggestions.

1 Like

Have you profiled your app on your laptop to see how much RAM it’s using? I’m guessing your laptop probably has more than 1024M memory so it’s not impossible it runs without problems locally but runs out of memory remotely?

Depending on how exactly you’re making your 70k points plots it could be consuming a lot of memory. Hard to know without more details. One option might be to look into Plotly’s WebGL plotting functions?

I have now, thanks :wink:

import os, psutil
>>> pid = 49947
>>> ps = psutil.Process(pid)
>>> memoryUse = ps.memory_info()
>>> memoryUse
pmem(rss=285614080, vms=4832661504, pfaults=128962, pageins=2361)

#for convenience
rss       285,614,080
vms		4,832,661,504
pfaults	      128,962
pageins.        2,361

Also Activity Monitor on the mac says…
Memory 260.0 MG
Python 3.7 8
Threads 4
Ports 17
Real Mem 232.4

Perhaps you can help me make sense of this?
FYI, on heroku we seem to be running Python 3.6…