You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm pretty sure I'm running into #1345, but I don't know how to apply the fix, so I'm creating a new issue.
I'm using a widget to show a new bokeh plot when I hit "next". A simple version of the problem:
from bokeh.plotting import figure, output_notebook, show
import ipywidgets as widgets
from ipywidgets import Layout,Box
output_notebook()
import numpy as np
def plot_sample_bokeh(i):
f = figure(title="test")
f.line(np.arange(100), np.random.randn(100))
show(f)
to_annotate = np.arange(100)
cur_index = 0
def display_img_widget(i):
with out_widget:
plot_sample_bokeh(i)
def on_button_click(b):
global to_annotate, cur_index
cur_id = to_annotate[cur_index]
cur_index += 1
if cur_index == len(to_annotate):
print('End of collection')
return
out_widget.clear_output(wait=True)
display_img_widget(to_annotate[cur_index])
a_button = widgets.Button(description='next', button_style='primary')
a_button.on_click(on_button_click)
out_widget = widgets.Output(width=1100, height=600)
display_img_widget(to_annotate[0])
form_item_layout = Layout(
display='flex',
flex_flow='row',
justify_content='flex-start', width='100%')
form = VBox([a_button, out_widget], layout=form_item_layout)
form
If this is run in a Jupyter notebook, and the 'next' button is repeatedly clicked, you can watch the memory usage of the webpage climb in chrome. Restarting the kernel doesn't reduce the memory usage of the page and eventually, the page will just crash.
How do I go about fixing this?
The text was updated successfully, but these errors were encountered:
Actually just ran into this issue myself yesterday. I'm looking at ways of modifying the structure of my code to try and reduce the memory usage and overhead. I plan to try and update the data in my plot rather than creating a whole new figure each time. Do you think this would help you @spott ?
It appears that my particular problem is likely related to Bokeh itself, rather than ipywidgets, though I'm not sure if it is something in Bokeh that needs to be deleting references, or something else.
Hey @nickpollari and @spott
We encountered than error with Bokeh. And therefore we tried plotly. Plotly does not have a memory leak. So this is definitely related to Bokeh.
I'm pretty sure I'm running into #1345, but I don't know how to apply the fix, so I'm creating a new issue.
I'm using a widget to show a new bokeh plot when I hit "next". A simple version of the problem:
If this is run in a Jupyter notebook, and the 'next' button is repeatedly clicked, you can watch the memory usage of the webpage climb in chrome. Restarting the kernel doesn't reduce the memory usage of the page and eventually, the page will just crash.
How do I go about fixing this?
The text was updated successfully, but these errors were encountered: