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

Add docs on profiling with VisualVM #2251

Merged
merged 9 commits into from
Feb 18, 2024
Merged

Conversation

Daltz333
Copy link
Member

@Daltz333 Daltz333 commented Apr 30, 2023

Fixes #2229

@Daltz333
Copy link
Member Author

I should probably detail not just memory usage, but function timing

@Daltz333
Copy link
Member Author

@sciencewhiz done, if you can review

jvmArgs.add("-Dcom.sun.management.jmxremote.local.only=false")
jvmArgs.add("-Dcom.sun.management.jmxremote.ssl=false")
jvmArgs.add("-Dcom.sun.management.jmxremote.authenticate=false")
jvmArgs.add("-Djava.rmi.server.hostname=10.XX.XX.2") // Replace XX.XX with team number
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work with mDNS? If so, that would avoid the needing to specify different IPs for different networking configs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure, pending testing.

@@ -11,3 +11,4 @@ GradleRIO is the mechanism that powers the deployment of robot code to the roboR
code-formatting
gradlew-tasks
deploy-git-data
profiling-with-visualvm
Copy link
Collaborator

@sciencewhiz sciencewhiz Apr 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that advanced-gradlerio is the place for this. It does require modifying build.gradle. There isn't a great place that already exists, maybe telemetry?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not place it in telemetry, as I don't think we typically want to recommend users modify their build.gradle. If this is something common, we could enable it by default?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @Daltz333 that users should only be enabling this for diagnosis and shouldn't be in the build.gradle deployed for matches. I think that Software Tools might not be a bad place for this, but not Telemetry for the same reason as Daltz said.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I explained my concern with putting it in the advanced gradlerio section correctly. The other things in that section are permanent items that a team wants to change the build process. This is a temporary item to help with debugging. Because of that, I think it belongs elsewhere.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Software Tools?

:alt: Viewing a dump in VisualVM
:width: 700

Clicking on :guilabel:`Summary` and selecting :guilabel:`Objects` instead will show a breakdown of objects by quantity. The below screenshot showcases a completely empty robot program, and then one that creates an million large ``ArrayList`` of integers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to see where those million integers is created? I'm not sure there's much useful for teams based on what's shown in the screenshot.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I'll have to find that out myself

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In dotMemory, it shows the creation call stack, I wonder if VisualVM has something similar.

@jasondaming
Copy link
Member

This seems like something it would be great to merge before the season starts. Is there more left to do?

@sciencewhiz sciencewhiz merged commit 8dc6b15 into wpilibsuite:main Feb 18, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add page explaining how to use VisualVM on the RIO
7 participants