Embedding bokeh plot in HTML eats memory

My colleague and I are working on a simple, locally hosted website through which a data stream produced by a few measurement devices can be viewed. We would like to use bokeh to embed live updating plots on our website, and are trying to get a simple prototype to run. We follow the embed example “animated” pretty closely, but the problem is that the browser we use to view the plot starts to use huge amounts of memory. Forcing ourselves to close the browser every few minutes (the data comes in at a pretty high rate) is not an option.

We did not test the “spectrometer” example, but this would seem to work without any memory issues. Is this due to the fact that a JavaScript is used to render the plot somehow? Or can we solve this problem purely in Python, without having to write in JavaScript?

The MWE is available at https://www.dropbox.com/s/n7yvja14dgov9gs/StackExchange.7z?dl=0 In order to reproduce the problem, run ‘bokeh-server --backend=memory’, the ‘plotting.py’ in the app folder, and then ‘run.py’ in the StackExchange folder. Go to localhost:5000/data and watch the memory usage climb.

I have asked the same question on StackExchange: http://stackoverflow.com/questions/28939097/embedding-bokeh-plot-in-html-eats-memory

Hi,

Thanks very much for this report (and especially a MWE). This definitely sounds like a bug. When updating from the server, Backbone machinery is used. As you mention, the spectrogram updates are handles explicitly with a small bit of custom JS. It's possible there is some cleanup that is not happening correctly in the Backbone code path. Can you file this is on the Bokeh GH issue tracker? (https://github.com/bokeh/bokeh/issues) It will get wider visibility among the Bokeh devs there.

Thanks!

Bryan

···

On Mar 9, 2015, at 5:14 AM, [email protected] wrote:

My colleague and I are working on a simple, locally hosted website through which a data stream produced by a few measurement devices can be viewed. We would like to use bokeh to embed live updating plots on our website, and are trying to get a simple prototype to run. We follow the embed example "animated" pretty closely, but the problem is that the browser we use to view the plot starts to use huge amounts of memory. Forcing ourselves to close the browser every few minutes (the data comes in at a pretty high rate) is not an option.

We did not test the "spectrometer" example, but this would seem to work without any memory issues. Is this due to the fact that a JavaScript is used to render the plot somehow? Or can we solve this problem purely in Python, without having to write in JavaScript?

The MWE is available at https://www.dropbox.com/s/n7yvja14dgov9gs/StackExchange.7z?dl=0 In order to reproduce the problem, run 'bokeh-server --backend=memory', the 'plotting.py' in the app folder, and then 'run.py' in the StackExchange folder. Go to localhost:5000/data and watch the memory usage climb.

I have asked the same question on StackExchange: http://stackoverflow.com/questions/28939097/embedding-bokeh-plot-in-html-eats-memory

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/1be89e3c-f36e-4643-8ecc-ebde77b6453f%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.