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

Improve the problem of lagging or even OOM caused by reactivation after hanging in the background for a long time #120

Closed
wants to merge 1 commit into from

Conversation

mzzsfy
Copy link

@mzzsfy mzzsfy commented Jan 4, 2024

No description provided.

…er hanging in the background for a long time
@arl
Copy link
Owner

arl commented Jan 4, 2024

Hi and thank you for contributing
Can you say a bit more about the issue and explain the solution you implemented to resolve it.

@mzzsfy
Copy link
Author

mzzsfy commented Jan 4, 2024

When your page is in the background for a long time (minutes or even hours, Chrome), the callback of websocket.onmessage will not be processed on time. When the page is reactivated, onmessage is called repeatedly, which will generate a large number of UI redraw, which will cause the page to freeze or even OOM
My solution is to separate the ui redrawing from the onmessage method and use the setInterval method to render the ui separately. When onmessage is called repeatedly, a large number of ui redrawing will not occur.

@arl
Copy link
Owner

arl commented Jan 4, 2024

I see, thank you very much.

@mzzsfy
Copy link
Author

mzzsfy commented Jan 4, 2024

Nice, so when will this be released to the next version? I have encountered this problem many times. In the worst case, I need to use the task manager to forcefully close chrome.

@arl
Copy link
Owner

arl commented Jan 4, 2024

Nice, so when will this be released to the next version?

As soon as I've got the time to try your PR, merge it and tag a release. I hope to have time today, or else it's going to be during the weekend

@mzzsfy
Copy link
Author

mzzsfy commented Jan 4, 2024

I see, thank you very much.

@arl
Copy link
Owner

arl commented Jan 6, 2024

I've tried to reproduce the problem you were having but I couldn't.
Can you detail the steps needed to reproduce it please, by creating a new issue so it 'd be easier to keep track thank you?

@mzzsfy
Copy link
Author

mzzsfy commented Jan 6, 2024

Windows systems,open web page, use Microsoft Edge and play the video in full screen. It will take about a few minutes to reproduce the problem(Make sure the energy -saving mode is not closed).If you still can't reproduce this scenario, I will submit an issue

mzzsfy added a commit to mzzsfy/statsviz that referenced this pull request Jan 6, 2024
@mzzsfy
Copy link
Author

mzzsfy commented Jan 6, 2024

Already solved #122

@mzzsfy mzzsfy closed this Jan 6, 2024
mzzsfy added a commit to mzzsfy/statsviz that referenced this pull request Jan 6, 2024
delete websocket
done arl#117
done arl#119
done arl#120
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

Successfully merging this pull request may close these issues.

2 participants