Dash graphs not loading and memory error


I have two graphs that callback on interval every second. However when it’s two graphs I dont get the graphs displayed. It works fine if it’s only one.

After a while, I also get a memory error below.

MemoryError - - [28/Nov/2017 18:30:32] "POST /_dash-update-component HTTP/1.1" 500 -
Error on request:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\werkzeug\serving.py", line 209, in run_wsgi
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\werkzeug\serving.py", line 199, in execute
    for data in application_iter:
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\werkzeug\debug\__init__.py", line 319, in debug_application
    secret=self.secret) \
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\werkzeug\debug\tbtools.py", line 360, in render_full
    'summary':          self.render_summary(include_title=False),
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\werkzeug\debug\tbtools.py", line 334, in render_summary
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\werkzeug\debug\tbtools.py", line 424, in render
    'lines':            self.render_line_context(),
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\werkzeug\debug\tbtools.py", line 428, in render_line_context
    before, current, after = self.get_context_lines()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\werkzeug\debug\tbtools.py", line 537, in get_context_lines
    before = self.sourcelines[self.lineno - context - 1:self.lineno - 1]
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\werkzeug\utils.py", line 73, in __get__
    value = self.func(obj)
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\werkzeug\debug\tbtools.py", line 534, in sourcelines
    return source.decode(charset, 'replace').splitlines()

Any suggestions as to why this might occur?

# dcc.Graph(id='example-graph3'),
# dcc.Graph(id='example-graph4'),
    interval=1 * 1000  # in milliseconds
> @app.callback(dash.dependencies.Output('example-graph1', 'figure'),
>     [dash.dependencies.Input('cl', 'values')],
>   events=[Event('interval-component1', 'interval')])
> def update_figure1(values):
>     figure = update_figure(5, "first", values)
>     return figure

Hm, I’m not sure why this is happening. Are each graph’s callbacks called?

You might want to try to increase the interval length to something like 5 seconds (5 * 1000) in case the calls are piling up

A memory error means that your program has ran out of memory. If you get an unexpected MemoryError and you think you should have plenty of RAM available, it might be because you are using a 32-bit python installation. This could be caused by either the 2GB per program limit imposed by Windows (32bit programs), or lack of available RAM on your computer. The easy solution, if you have a 64-bit operating system, is to switch to a 64-bit installation of python. The issue is that 32-bit python only has access to ~4GB of RAM. This can shrink even further if your operating system is 32-bit, because of the operating system overhead.