vSphere 5.1: Monitoring Memory with vSphere Web Client

The EM4J plug-in for vSphere Web Client 5.1 adds statistics about VM memory utilization to the vSphere 5.1 Web Client. You can quickly verify whether the VM and JVMs are configured correctly for EM4J ballooning and see detailed information about JVM processes and memory usage.

The EM4J plug-in displays data collected by the Console Guest Collector (CGC), a utility you install in each virtual machine. The CGC collects memory statistics from the OS and from JVMs, including JVMs that do not have EM4J enabled. The vSphere Web Client retrieves this data from the virtual machine and displays it on the Monitor > Workloads tab for the selected virtual machine.

The EM4J plug-in displays both current (snapshot) and historical data. The historical data is displayed on the Monitor > Workloads > History page.

For information about installing the EM4J plug-in in the vSphere Web Client, see Set Up the vSphere Web Client EM4J Plug-in.

For information about setting up the CGC, see Install and Run the Console Guest Collector.

Viewing Java Workloads in the vSphere Web Client

When the vSphere Web Client EM4J plug-in is installed, use the navigator or inventory tree to select a VM in the left panel. In the following illustration, the vmc-ssrc-rh70 VM is selected.

When a VM is selected in the left panel, the center panel displays detailed information about the VM. Click the Monitor tab, then click the Workloads tab. If the EM4J plug-in detects Java workloads executing on the VM, they are listed at the left of the center panel. The following illustration shows one Java workload, executing with process ID 31829.

You can select from four sub-tabs on the Workloads tab to display information about the virtual machine and the JVM, if one is selected in the list.

Summary Tab

The Workload Summary tab shows information about the workload selected in the Workloads list.

Status

The Status section shows information about the state of EM4J for the workload.

Table 17. Attributes in the Status Section

AttributeDescription
StatusThe overall status for Elastic Memory for Java, either Normal, Information, Warning, or Error. The Status shown is the highest severity of all alerts that exist for the workload. By default, all alerts for the workload are displayed. Click the expand arrow to toggle the detail view.
EM4J Agent EnabledIndicates whether the virtual machine is configured properly for Elastic Memory for Java.
JMX EnabledIndicates if JMX is enabled for the JVM.

EM4J Version

The EM4J Version section shows the versions for the Elastic Memory for Java components: Agent, Console Guest Collector, and the vSphere Web Client EM4J plug-in.

Table 18. Attributes in the EM4J Version Section

AttributeDescription
AgentThe version number of the Elastic Memory for Java agent library for the selected workload, or "unavailable", if the agent cannot be determined.
Console Guest CollectorThe version number of the Console Guest Collector running on the virtual machine executing the selected workload.
Console UI Plug-inThe version number of the EM4J plug-in for the vSphere Web Client.

Annotations

The Annotations section displays descriptive information associated with the workload. The Notes field displays a list of possible application names, based on the main class the JVM executed. If the main class is org.apache.catalina.startup.Bootstrap, "Apache Tomcat-based Server" is displayed, indicating the JVM is running Apache Tomcat or vFabric tc Server. If the main class is org.jboss.modules.Main, the annotation is "JBoss".

JVM Details

The JVM Details section displays information about the Java virtual machine.

Table 19. Attributes in the JVM Details Section

AttributeDescription
PIDThe operating system process ID for the executing JVM process.
Main ClassThe name of the main Java class the JVM executed on startup.
Guest OS Supports Large PagesIndicates if /proc/sys/vm/nr_hugepages exists with non-zero contents, which signals that the guest OS is configured to use large memory pages. Using large memory pages is a best practice for running Java on in a virtual machine, but is not a requirement to use Elastic Memory for Java.
Guest OS Large Page CountThe number of large pages configured in the guest OS; the contents of /proc/sys/vm/nr_hugepages.
JVM Using Large PagesIndicates if the JVM is using large memory pages. JVM large page support is enabled with the -XX:+UseLargePages Java command line option.
Java VersionDisplays the Java version of the JVM, if it is available from the Console Guest Collector. The property does not appear if the Java version is unknown.
Java VendorDisplays JVM vendor information, if it is available from the Console Guest Collector. Does not appear if the JVM vendor is unknown.

Related Items

The Related Items section lists information about the location of the virtual machine in the vSphere Web Client inventory.

Table 20. Attributes in the Related Items Section

AttributeDescription
Virtual MachineThe name of the virtual machine where the workload is executing.
HostThe host name or IP address of the ESXi host.
Resource PoolThe name of the resource pool the virtual machine belongs to.

Alerts Tab

The Alerts tab displays a list of alerts that have been activated in response to the state of a Java workload.

Alerts are messages that report real or potential configuration problems that prevent Elastic Memory for Java from operating normally.

Elastic Memory for Java alerts have a severity of Information, Warning, Error, Java Best Practice, or Log Message. An alert with a severity of Information reports a non-error condition that prevents Elastic Memory for Java from running. For example, if there are no JVMs running on the virtual machine, an alert with Information severity reports the fact.

An alert with Warning severity reports an error condition that prevents Elastic Memory for Java from operating normally. For example, if the Console Guest Collector on a virtual machine is unable to connect to the JMX port of a JVM, an alert with Warning severity is issued.

Java Best Practice alerts are suggestions to help improve performance when running Java on a virtual machine, for example, using large memory pages when the OS supports them.

An alert with Log Message severity is a message from the Console Guest Collector or the Elastic Memory for Java agent with a normal status, for example, startup messages. In the absence of other issues, these messages affirm that normal, expected events have occurred.

The Status displayed on the Workloads list is the most severe alert level for the workload, or Normal if there are no alerts. When determining the severity, Java Best Practice alerts are treated as Information alerts.

Messages from the Console Guest Collector or the Elastic Memory for Java agent that are not recognized by the vSphere Web Console EM4J plug-in are passed through untranslated, as en_US locale messages, with the severity assigned by the originating source. These messages are prefixed with either "EM4J Console Guest Collector:" or "EM4J Agent:".

A list of alert messages can be found in the Alerts topic in the vSphere Web Client online Help.

Monitor Resources Tab

The Monitor Resources tab displays information about memory usage in JVMs and the virtual machine, and JVM garbage collections.

The Elastic Memory for Java memory statistics displayed on the Monitor Resources tab are snapshots of memory utilization and garbage collection at the last update time displayed to the right of the tabs. Clicking the refresh icon updates the display with new data if it is available.

Note

The JVM Heap memory statistics include details reported by all JVMs running when the CGC last published data. When a JVM exits, its balloon memory can persist in the ESXi-managed balloon for the virtual machine, although it is no longer associated with a JVM. For this reason, the total balloon size reported for all Elastic Memory for Java-enabled JVMs may be less than the actual balloon size.

Heap Memory: Selected JVM

This section includes a stacked bar graph depicting the composition of heap memory in the JVM selected in the Workloads list.

Table 21. JVM Heap Memory Statistics

AttributeDescription
Committed Heap MemoryAmount of heap memory currently allocated to the JVM. It varies as the JVM requests additional memory or releases memory to the operating system. Committed Heap Memory is the sum of Application Heap Memory, Ballooned Heap Memory, Elastic Memory for Java Shareable Heap Memory, and Free Heap Memory.
Application Heap MemoryAmount of heap memory currently used, excluding Elastic Memory for Java ballooned and shareable memory.
Ballooned Heap Memory (EM4J)Amount of the Elastic Memory for Java memory reclaimed by ESXi.
EM4J Shareable Heap MemoryAmount of heap memory objects owned by EM4J that are not currently ballooned, but can still be reclaimed by ESXi as zero-shared memory.
Free Heap MemoryAmount of free heap memory.

The portion of heap memory that is in use contains objects stored by applications running on the JVM (Application Heap Memory) as well as objects created by Elastic Memory for Java. Of the memory controlled by Elastic Memory for Java, some may be reclaimed by ESXi to satisfy the balloon target for the virtual machine (Ballooned Heap Memory) and the remainder is zero-filled, making it available to ESXi to reclaim with transparent page sharing (Elastic Memory for Java Shareable Memory).

Heap Memory: All JVMs

This section includes a stacked bar graph depicting the composition of heap memory for all JVMs running on the virtual machine.

Table 22. JVM Heap Memory Statistics

AttributeDescription
Total Committed Heap MemoryTotal amount of committed heap memory for all JVMs on the virtual machine.
Total Application Heap MemoryTotal amount of heap memory used by all JVMs on the virtual machine, excluding Elastic Memory for Java ballooned and shareable memory.
Total Ballooned Heap Memory (EM4J Balloon)Total amount of heap memory reclaimed by all Elastic Memory for Java balloons on the virtual machine.
Total EM4J Shareable Heap MemoryTotal amount of heap memory objects owned by Elastic Memory for Java that are not currently ballooned, but that could be reclaimed by ESXi as zero-shared memory.
Total Free Heap MemoryTotal amount of free heap memory for all JVMs on the virtual machine.

Garbage Collectors

The Garbage Collectors section displays a list of the JVM's garbage collectors.

Table 23. Garbage Collectors Statistics

AttributeDescription
NameName of the garbage collector.
Collection CountCumulative number of garbage collections.
Collection Time (ms)Cumulative execution time of the garbage collector, in milliseconds.

Initial Memory Configuration

The Initial Memory Configuration section describes the initial JVM memory layout as configured on the java command line.

Table 24. Initial Memory Configuration

AttributeDescription
Maximum Heap SizeMaximum heap size, specified with the -Xmx JVM option.
Minimum Heap SizeMinimum heap size, specified with the -Xms JVM option.
Maximum PermGen SizeMaximum size of the HotSpot permanent generation, specified with the -XX:MaxPermSizeJVM option.
Thread Stack SizeSize of the stack for each thread, specified with the -Xss JVM option.
Using Large PagesWhether the JVM is using large memory pages. Specified with the -XX:+UseLargePages JVM option. Large memory support must be configured in the OS to enable this option.

History Tab

The History tab displays a graph of virtual machine memory usage over time. The graph provides data that, combined with the Administrator's knowledge of system loads, can be used to help set the virtual machine's memory size most effectively.

The graph displays data sampled by the Console Guest Collector (CGC) at a regular intervals during the sampling period. There are two versions of the graph, depending on whether EM4J or the VMware Tools (guest) balloon is active in the virtual machine.

Virtual Machine Memory Usage - Guest Balloon

When the virtual machine is configured to use the VMware Tools guest balloon, the graph appears similar to the following sample.

Table 25. Virtual Machine Memory Usage (Guest Balloon)

AttributeDescription
vRAM SizeConfigured virtual memory size for the virtual machine.
Effective vRAM Size (Guest Balloon)vRAM size less the balloon size. The distance between vRAM Size and Effective vRAM Size represents the ballooned memory.
Minimum Effective vRAM Size (Guest Balloon)Smallest amount of effective vRAM size (corresponds to the largest balloon size) during the sampling period.
Potential Heap Size (-Xmx)Potential size of the heaps for all JVMs on the virtual machine. This is the sum of the -Xmx settings for the JVMs.
Committed Heap SizeSum of the committed heap memory for all JVMs on the virtual machine. Committed Heap Memory is the memory currently allocated to a JVM, the sum of the JVM heap memory pages that have been written to since the JVM process started, as seen by the OS.
Other Memory SizeMemory used for all other purposes on the virtual machine. This is all memory in use, less the Potential Heap Size.
Paging Rate (Pages/Second)A measure of swapping in pages/second.

Virtual Machine Memory Usage (EM4J Balloon)

When Elastic Memory for Java is configured for the JVM, the graph appears similar to this sample.

Table 26. Virtual Machine Memory Usage (EM4J Balloon)

AttributeDescription
vRAM SizeConfigured virtual memory size for the virtual machine.
Potential Heap Size (-Xmx)Potential size of the heaps for all JVMs on the virtual machine. This is the sum of the -Xmx settings for the JVMs.
Effective Potential Heap Size (EM4J Balloon)Potential heap size less the balloon size. The distance between Potential Heap Size and Effective Potential Heap Size represents the ballooned memory.
Committed Heap Size

Sum of the committed heap memory for all JVMs on the virtual machine.

Other Memory SizeMemory used for all other purposes on the virtual machine. This is all memory in use, less the Potential Heap Size.
Paging Rate (Pages/Second)A measure of swapping in pages/second.

The graph represents memory usage for the virtual machine, including all JVMs running on the virtual machine.

Interacting with the History Graph

The History graph has some interactive features. Drag the cursor over the graph to see details of the nearest sample. The dot on the line for the displayed value changes from solid to a circle with a dot in the middle. To highlight one line in the graph, click the name of the metric in the legend. Click again to unhighlight the line.

Right-click anywhere on the graph to view a context menu, with the following options.

Table 27. History Graph Context Menu

OptionDescription
Export to CSV...Saves the chart data to a CSV (comma-separated values) text file, suitable for importing into a spreadsheet.
Export to JPEG...Saves the chart as a JPEG image file.
Export to PNG...Save the chart as a PNG image file.
Reset EM4J historical data...Causes the Console Guest Collector to empty its data cache and begin collecting statistics again. Resetting the data causes the graph to refresh, but depending on timing, an additional refresh may be required to see the emptied cache. Requires VMODL privilege Privilege.VIRTUALMACHINE_CONFIG_RESETGUESTINFO. If the vSphere Web Client is unable to set a variable in the virtual machine's GuestInfo area, refresh fails and an error message in the task console describes the cause.

Memory Alerts

The Memory Alerts section flags memory events that could lead to performance problems or that have already caused paging. These conditions are detected in the metrics gathered by the Console Guest Collector and are illustrated on the Workloads > History graph if they occurred within the displayed sampling time period. The alerts do not affect the status for the workload on the Summary tab.

View a list of memory alerts in the Online help for this the Workloads History tab.