Java Management Extensions (JMX)
The Java platform supplies tools for managing and monitoring. The JMX architecture lets you build in instrumentation to report current status at runtime.
That reporting is done in a standardized way so that a variety of dashboard apps can consume that data and display to the sysadmin human users. Your JVM implementation likely comes with some kind of JMX monitoring dashboard tool.
You or your sysadmins may choose to use other monitory dashboard tools. That's the beauty of JMX, no need to change your code or your instrumentation when the sysadmin switches their dashboard/monitor. With JMX the internal instrumentation is decoupled from the runtime monitoring.
Libraries and other software your app may be using may also be instrumented with JMX. For example, Tomcat running your Servlet app. So you can use one dashboard to monitor your own code as well as those libraries you leverage.
SNMP
Simple Network Management Protocol (SNMP) is an industry standard for collecting and organizing information about managed devices on IP networks and for modifying that information to change device behavior. You can find many SNMP-based tools available on many platforms.
JMX can be adapted to plug into SNMP tooling.
Java Monitoring and Management Console (jconsole)
Some JVM implementations are themselves instrumented via JMX. These include both the Oracle JVM and the OpenJDK project. So you can see inside them at runtime to example memory usage, CPU usage, and so on, as you asked in your Question.
The jconsole tool is a JMX-compliant graphical tool for monitoring a Java virtual machine. It can monitor both local and remote JVMs. It can also monitor and manage an application. Oracle provides jconsole with their JVM. It can be found in the OpenJDK project as well.
Java Mission Control & Java Flight Recorder
Java Mission Control (JMC) is a JDK profiling and diagnostics tools platform for the Oracle JVM. It is a tool suite for basic monitoring, managing, and production time profiling and diagnostics with high performance. Java Mission Control minimizes the performance overhead that's usually an issue with profiling tools.
Java Mission Control originated as a commercial tool at Oracle, but is now being open-sourced and donated to the OpenJDK project.
Java Flight Recorder (JFR) is a tool for collecting diagnostic and profiling data. JFR collects data about the JVM as well as the Java application running on it. JFR is being donated to the OpenJDK project, along with Mission Control.
More info