I’m working on a little data dashboard site running on bokeh but am having a problem where after a tab is closed and the session destroyed, local memory is not freed. In general I’m using an embedded server in Flask, mostly as put together from bits of the User Guide and various examples but the same behaviour can be seen by just taking the sliders.py example and importing a big dataframe at the start.
So more explicitly, looking at the memory used by the ‘bokeh’ process on my system monitor, running
bokeh serve sliders.py
If I open a few tabs with the modified file including the big dataframe load (either from a pickle or from sql), memory quickly shoots up to several hundred MB. closing the tabs and waiting for timeout does nothing to lower that number. If I change it to a directory style format and include the server_lifecycle.py file and tell it to print out when it reaches on_session_destroyed, I can see that the session is destroyed but it still doesn’t release any memory. In this form and when embedded in the flask app, memory is only released when killing the python process.
Is this something I’ll have to get around using some sort of process control or is there some sort of way to force it to release memory?
In terms of usage, I expect it to not run that frequently, so I can regularly restart the process, but the problem as it stands would be multiple people using it at the same time to compare between them, jumping between pages and those pages not clearing out when clicked away from, eventually leading to a crash.
os: linux mint 18
Thanks very much,