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

be careful here but this may fix a memory issue #9

Merged
merged 1 commit into from
Mar 23, 2024

Conversation

sfwasleski
Copy link
Contributor

BE CAREFUL... Sorry for the drive by code suggestion but a notification about state machine changes came across my email and I got curious.

It appears that in StateMachine.activateState, that a new instance of the command is created every time the state is activated. It may be that this is required by some fine point of the design that I am not aware of but I am a bit concerned that this could eat up memory and lead to some GC pauses or worse OOM exceptions.

The proposed changes only creates a command instance on the first activation and then reuses it on subsequent activations.

PLEASE BE CAREFUL, especially at competition.

@Maaz-Hawa Maaz-Hawa merged commit 0df7aa0 into master Mar 23, 2024
1 check passed
@Maaz-Hawa Maaz-Hawa deleted the potentialMemoryFix branch March 23, 2024 13:00
StarbuckBarista added a commit that referenced this pull request Mar 24, 2024
This reverts commit 0df7aa0, reversing
changes made to 1d6b504.
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