Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I use bqplot to draw the browser memory grow up #1600

Open
RockBB opened this issue Apr 13, 2023 · 0 comments
Open

When I use bqplot to draw the browser memory grow up #1600

RockBB opened this issue Apr 13, 2023 · 0 comments

Comments

@RockBB
Copy link

RockBB commented Apr 13, 2023

Browser memory grow up
When I use bqplot to draw, I constantly update the values of x and y in the line. At this point, leaving the current page to another browser page or minimizing the browser will cause two problems: 1. The browser memory occupied by the drawing page will continue to grow until the page crashes; 2. The drawing operation of the drawing page will only be drawn when the interface is continuously open, and will not be drawn when leaving the interface to go to other interfaces.

Test code

import time
import numpy as np  # For numerical programming and multi-dimensional arrays
from bqplot import Lines, LinearScale, Axis, Figure
security_1 = np.cumsum(np.random.randn(200)) + 100.0
security_2 = np.cumsum(np.random.randn(200)) + 100.0

sc_x = LinearScale()
sc_y = LinearScale()

line = Lines(x=np.arange(len(security_1)), y=security_1, scales={"x": sc_x, "y": sc_y}, close_path=True)
ax_x = Axis(scale=sc_x, label="Index")
ax_y = Axis(scale=sc_y, orientation="vertical", label="y-values of Security 1")

fig = Figure(marks=[line], axes=[ax_x, ax_y], title="Security 1", animation_duration=10)
fig
for i in range(10000):
    with fig.hold_sync():
        with line.hold_sync():
            line.x =  np.cumsum(np.random.randn(200)) + 100.0
            line.y = np.cumsum(np.random.randn(200)) + 100.0
            time.sleep(1)

Expected behavior

1、Browser memory remains stable when not in the drawing interface
2、The drawing program continues to complete the drawing when leaving the current drawing interface

Screenshots
图片
图片

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant