From 0e1e0573bb78981fcc61a9ed0f01ca5dfb4b8558 Mon Sep 17 00:00:00 2001 From: Garrett Summerfield Date: Sun, 17 Mar 2024 13:44:52 -0500 Subject: [PATCH] Add VisualVM remote debugging VisualVM is a Java profiler that can help investigate where memory and other resources are being used during runtime. This also helps with figuring out when the JVM does garbage collection and whether or not we need to have it increase due to memory constraints. --- build.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.gradle b/build.gradle index 5083441..b43ae07 100644 --- a/build.gradle +++ b/build.gradle @@ -27,6 +27,13 @@ deploy { // getTargetTypeClass is a shortcut to get the class type using a string frcJava(getArtifactTypeClass('FRCJavaArtifact')) { + // Enable VisualVM connection + jvmArgs.add("-Dcom.sun.management.jmxremote=true") + jvmArgs.add("-Dcom.sun.management.jmxremote.port=1198") + 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.87.19.2") } // Static files artifact