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

Shuffleboard wasting resources #652

Open
shaked113021 opened this issue Feb 20, 2020 · 13 comments
Open

Shuffleboard wasting resources #652

shaked113021 opened this issue Feb 20, 2020 · 13 comments

Comments

@shaked113021
Copy link

Our team uses shuffleboard to display values to the drivers. In the last couple of days, shuffleboard suddenly started taking crazy amounts of memory and processing power. Almost 90% cpu power and 8 gb of RAM and it also started lagging like crazy (even though by looking in outline viewer we can clearly see that they are updating normally)

@AustinShalit AustinShalit transferred this issue from wpilibsuite/frc-docs Feb 20, 2020
@Daltz333
Copy link
Member

Are you using graphs of any kind?

@shaked113021
Copy link
Author

shaked113021 commented Feb 21, 2020

We are using a combo box for path choosing, for everything else we use text views which are for displaying and retrieving data. No graphs.

@sciencewhiz
Copy link
Contributor

What about cameras? Can you post your save file?

@shaked113021
Copy link
Author

shaked113021 commented Feb 21, 2020

We don't save files nor cameras, for now we solved the problem, we accidentally used enableActuatorWidgets in an inappropriate place. Shuffleboard is still showing very high memory usage, using JProfiler I have discovered that it creates a lot of weakreferences,the number of which is growing abnormally. they all on WeakReferenceQueues(part of javafx) which is used in the Classes DataFormat, ConstraintBase, PathElement and Transform(and their child classes).

@Daltz333
Copy link
Member

Hm. I can't seem to reproduce, do you have any test case?

@AE173
Copy link

AE173 commented Feb 22, 2020

Hm. I can't seem to reproduce, do you have any test case?

Yes, we added you as a collaborator to our repo. OnyxTronix2020

@shaked113021
Copy link
Author

Hm. I can't seem to reproduce, do you have any test case?

Yes, we added you as a collaborator to our repo. OnyxTronix2020

Please use branch develop as test case

@nimrod46
Copy link

nimrod46 commented Feb 22, 2020

Contrary to what @shaked113021 said, it didn't solved our problem, the shuffleboard seams to freeze after we enable our robot.
@Daltz333 We really need a quick fix for that as we are getting close to our first competition.
Thank you for your help!

@Daltz333
Copy link
Member

I can't seem to find anything obvious, but I ran your code on my desktop using the WPILib Sim and my CPU usage never rose over 5% and RAM over 550MB.

There have been issues with LiveWindow and performance in the past, could you try disabling any LiveWindow related functions and seeing the performance then?

Specs:
Ryzen 5 1500x
GTX 970
DDR4 2800MHz RAM
SATA SSD

@nimrod46
Copy link

@Daltz333 I don't think it's possible to reproduce the problem while simming.

How can we disable the LiveWondow completely?

@AE173
Copy link

AE173 commented Feb 23, 2020

I can't seem to find anything obvious, but I ran your code on my desktop using the WPILib Sim and my CPU usage never rose over 5% and RAM over 550MB.

There have been issues with LiveWindow and performance in the past, could you try disabling any LiveWindow related functions and seeing the performance then?

Specs:
Ryzen 5 1500x
GTX 970
DDR4 2800MHz RAM
SATA SSD

We managed to fix the issue using LiveWindow.disableAllTelemetry();.
Apparently the Shuffleboard gets stuck after moving the robot (pushing the robot in disable mode as well).
F.Y.I, We tried defining our motors without using WPI_ classes which did not help :/.

Thank you all for your help, we will keep this issue open...

@Daltz333
Copy link
Member

So LiveWindow was the cause? Thanks.

@neel-j-dev
Copy link
Contributor

Shuffleboard memory leaks could also be happening due to multiple ObservableValue objects being created but not garbage collected everytime a listener is triggered.

From: https://docs.oracle.com/javase/8/javafx/api/javafx/beans/value/ObservableValue.html#addListener-javafx.beans.value.ChangeListener-

The ObservableValue stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by calling removeListener after use or to use an instance of WeakChangeListener avoid this situation.

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

6 participants