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 appears to have memory leak #726

Open
jee7s opened this issue Mar 20, 2022 · 5 comments
Open

Shuffleboard appears to have memory leak #726

jee7s opened this issue Mar 20, 2022 · 5 comments

Comments

@jee7s
Copy link

jee7s commented Mar 20, 2022

Possibly related to #721

Describe the bug
Running shuffleboard for a long time (20 mins) results in apparent memory leak. Initial memory utilization starts at about 400MB, growing to 2400MB.

To Reproduce
Start Shuffleboard with robot disabled with disabled robot code reporting values. We report status of DIOs and some motors. We notably do not have cameras connected to the RIO when Shuffleboard includes camera displays. After consuming sufficient RAM, PC CPU utilization rises, resulting in long trip times >70ms and occasional intermittent packet loss. The packet loss is sufficient to briefly disable the robot for about 200ms

Expected behavior
Shuffleboard should not leak memory.

Screenshots
Will provide at next opportunity

Desktop (please complete the following information):

  • OS: Windows
  • Java version: OpenJDK version to be reported
  • Shuffleboard version: 2022.4.1

Additional context
This problem is difficult to detect at the field. FMS reports the long trip time and CPU utilization can be observed. But the root cause is not apparent without opening task manager.

@PeterJohnson
Copy link
Member

PeterJohnson commented Mar 20, 2022

In order to help us try to reproduce this, please upload your shuffleboard.json save file and point us to your robot code. Going to Help | About in Shuffleboard will confirm the Java version (JRE) and Shuffleboard version.

@Daltz333
Copy link
Member

Additionally, can you share task manager screenshots when the memory leak has occurred?

@jee7s
Copy link
Author

jee7s commented Mar 21, 2022

Robot code is here: https://gitihub.com/frc6357/robot_code_2022 on branch 'master'

JRE is 11.0.13+8 Eclipse Adoptium

DriverStation2022.json.txt

Extension change on JSON file to comply with github.com extension policy.

@jee7s
Copy link
Author

jee7s commented Mar 21, 2022

Attached are screen shots of Task Manager
MemoryLeakScreenShotAfter
MemoryLeakScreenShotBefore

During this test we did notice a correlation between having a graph visible on the Shuffleboard and the memory growth. We've read elsewhere that graphs consume more memory.

Is it possible we are observing an expected increase in memory usage due to the graph implementation? Does the graph hold on to more than the visible 30 seconds of data? If this is the expected behavior, then this bug may boil down to documentation for the possibility the laptop resources will be consumed and could result in the packet loss and intermittent disable behavior.

@ThadHouse
Copy link
Member

So something interesting about Java is it won't garbage collect until either the system says there is memory pressure, or a percentage of your memory (about 1/4) is used. So if you run on a system with a lot of memory, it will just keep using memory, and won't collect. There are some java profiling tools you can use to check for these cases. Based on your task manager logs, I'd suspect thats what is happening, as it looks like you have a lot of memory in your system.

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

4 participants