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

High memory usage #80

Closed
GRyall opened this issue Nov 20, 2024 · 5 comments · Fixed by #82
Closed

High memory usage #80

GRyall opened this issue Nov 20, 2024 · 5 comments · Fixed by #82
Assignees
Labels
bug Something isn't working

Comments

@GRyall
Copy link
Member

GRyall commented Nov 20, 2024

I left a tab open in Firefox overnight in the background with the wall display open. When I went to the tab this morning it was slow and unresponsive. When I closed the tab, Firefox memory usage declined by 650MB.

@Tom-Willemsen Tom-Willemsen added this to the Public Release milestone Nov 20, 2024
@Tom-Willemsen Tom-Willemsen added the bug Something isn't working label Nov 20, 2024
@rerpha
Copy link
Contributor

rerpha commented Nov 21, 2024

Could you see if this is also the case for:

  • the “instruments” page
  • One of the instruments pages, preferably with loads of blocks

@rerpha rerpha self-assigned this Nov 25, 2024
@rerpha
Copy link
Contributor

rerpha commented Nov 27, 2024

I think if it's just the instruments page I know exactly why - we use a different bit of logic on there and I have a feeling we're subscribing to the instlist every render, i'll do some profiling on it.

@Tom-Willemsen
Copy link
Contributor

The most obvious place we've seen this is the wall display page used for standup - but could also be happening elsewhere

@rerpha
Copy link
Contributor

rerpha commented Nov 27, 2024

ok - i'll have a look, cheers.

@rerpha
Copy link
Contributor

rerpha commented Nov 27, 2024

OK, I've figured this out. It's just the wall display, and the reason is we are using setInterval(5000) outside of a useEffect when getting the beam info image, then not clearing it, which means that the interval hooks get stored after every render(which happens every few milliseconds!). This means you end up with a huge buffer as well as the hooks not actually getting called every 5s in sequence. I actually managed to crash a chrome tab after about 45 mins as the memory limit is 512mb.

A bit more info on this here: https://www.geeksforgeeks.org/how-to-use-setinterval-method-inside-react-components/

This issue also meant that the interval wasn't actually working so this also fixes that. I've also slowed it from 5s to 15s as the image itself only updates every minute.

PR: #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants