Skip to content

Instantly share code, notes, and snippets.

@otbe
Last active November 17, 2021 13:10
Show Gist options
  • Select an option

  • Save otbe/7e31d92da86694231c1de6299bbefa82 to your computer and use it in GitHub Desktop.

Select an option

Save otbe/7e31d92da86694231c1de6299bbefa82 to your computer and use it in GitHub Desktop.
import java.lang.management.*;
import java.util.List;
public class JavaEnvironment {
public static void main(String args[]) {
System.out.println(
"Number of available processors: " + Runtime.getRuntime().availableProcessors());
System.out.println("GCs:");
ManagementFactory
.getGarbageCollectorMXBeans()
.forEach(x -> System.out.println(x.getName()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment