Setting Up vFabric Elastic Memory for Java

Elastic Memory for Java (EM4J) is included with vFabric tc Server Spring Edition. The Spring Edition includes all of the components and features of tc Server Standard Edition, plus Spring Insight Operations, EM4J, and Spring commercial support. You install both Spring Edition and Standard Edition with the Standard Edition installation bundle.

You enable EM4J in an ESXi virtual machine by adding a parameter to the virtual machine configuration and then specifying the EM4J agent on the java command line. The tc Server elastic-memory template automates configuring tc Runtime instances for EM4J.

The EM4J plug-in for vSphere Web Client provides additional memory monitoring capabilities in the vSphere Web Client. The EM4J plug-in requires that you install a JVM and run the Console Guest Collector (CGC) on each virtual machine you want to monitor. The CGC is installed from the tc Server elastic-memory template, but you do not have to run tc Server or EM4J to run the CGC and monitor virtual memory.

The following topics help you configure and run EM4J, the vSphere Web Client EM4J plug-in, and the CGC.


Enable EM4J in the Virtual Machine

Create and Start an EM4J-Enabled tc Runtime Instance

Configure an EM4J-Enabled tc Runtime Instance

Install the vSphere Web Client EM4J Plug-in

Install and Run the Console Guest Collector

Enable EM4J in the Virtual Machine

After you create a VM on ESXi, you enable EM4J in the VM by adding a parameter to the VM's configuration. You can add a second parameter to limit the size of the EM4J balloon, but it is unnecessary. The following table describes the parameters.

Table 1. EM4J VM Configuration Parameters

sched.mem.pshare.guestHintsSyncEnableWhen set to true, EM4J ballooning is enabled and guest ballooning is disabled. When set to false, guest ballooning is enabled and EM4J ballooning is disabled. This parameter is required to enable EM4J.
sched.mem.maxmemctlSets a limit for the total balloon size for the VM, in megabytes. If set to -1, the default, no limit, is set and ESXi determines the balloon size. If set to 0, ballooning is effectively disabled. It is generally unnecessary to set this parameter. The parameter affects both EM4J and VMware Tools balloons. If you set this parameter and later change the VM's configuration, this parameter will not change dynamically with the other changes.

When EM4J ballooning is enabled, the guest balloon is disabled. If you enable EM4J ballooning, but do not run an EM4J-enabled JVM, there will be no ballooning for the VM, which could lead to the ESXi host swapping pages from the VM. This situation is undesirable because host swapping occurs without insight into process activity, scheduling, and memory distribution in the VM. If you shut down a JVM with an EM4J balloon, the ballooned memory remains until it is written over. This means that the risk of swapping occurring after a JVM shutdown is at least initially very low.

The procedure describes how to add the EM4J configuration parameters using the vSphere Client. You can also add the parameters by editing the VM's VMX text file. After you enable EM4J, cloning the VM will duplicate the setup.



  1. Shut down the guest OS and, using vSphere Client, power off the VM, if necessary. It is not possible to edit the configuration parameters while the VM is running.

  2. In the left panel of the vSphere Client, expand the ESXi host so that the VM you want to configure is visible.

  3. Right-click the VM and select Edit Settings... from the pop-up menu.

  4. Click the Options tab.

  5. In the Settings column, under Advanced, select General. See the following figure.

  6. In the Configuration Parameters box on the right, click Configuration Parameters....

  7. Click Add Row and enter the following parameter, as shown in the following figure.

    • Name: sched.mem.pshare.guestHintsSyncEnable

    • Value: true

  8. (Optional) Click Add Row and enter the following parameter.

    • Name: sched.mem.maxmemctl

    • Value: -1 (or enter the maximum number of megabytes to limit the size of the EM4J balloon)

  9. Click OK twice.

  10. Repeat this procedure for each VM that will run an EM4J-enabled Java application.