shuffleboard
shuffleboard copied to clipboard
Shuffleboard wasting resources
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)
Are you using graphs of any kind?
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.
What about cameras? Can you post your save file?
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).
Hm. I can't seem to reproduce, do you have any test case?
Hm. I can't seem to reproduce, do you have any test case?
Yes, we added you as a collaborator to our repo. OnyxTronix2020
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
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!
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
@Daltz333 I don't think it's possible to reproduce the problem while simming.
How can we disable the LiveWondow completely?
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...
So LiveWindow was the cause? Thanks.
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.