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

KeyboardFuzzer has a substantial memory problem #1130

Closed
zepumph opened this issue Dec 29, 2020 · 3 comments
Closed

KeyboardFuzzer has a substantial memory problem #1130

zepumph opened this issue Dec 29, 2020 · 3 comments
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Dec 29, 2020

Because is uses stepTimer to simulate keys being down for X amount of time, fuzzing can build up a bunch of memory in the form of listeners waiting to be handled. The max time to wait is 2000ms. That means that 120* 100 (default fuzz rate) events could pile up in that time, and persist up to two more second into the future. In a minute or two in RAP, I was able to run out of memory in my tab and crash the sim because KeyboardFuzzer.keyupListeners had so many items in it.

In the future, I would like to be able to use ?fuzzBoard for memory testing. Right now this makes it impossible to do this. Tagging @jessegreenberg so he is aware.

@zepumph zepumph self-assigned this Dec 29, 2020
@zepumph
Copy link
Member Author

zepumph commented Jan 27, 2021

I think the above is actually not the issue. I think the problem is that clearListeners() isn't working. And so this.keyupListeners is keeping track of all closures that ever fire, and never removing them.

@zepumph
Copy link
Member Author

zepumph commented Jan 27, 2021

These listeners are now getting cleared as expected. When I poll for the length of the list, it seems to be a tolerable size, and not increasing too quickly.

image

I did find that perhaps since bd4c071, sliders aren't really moving at all. They are the central interaction in sims like RAP and GFL so I think I'll make a new issue.

@jessegreenberg
Copy link
Contributor

Thanks!

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

2 participants