Managing JVM Heap Size

This section discusses how to:

  • Monitor JVM heap.

  • Change JVM heap size.

Monitoring JVM Heap

The JVM heap size is the amount of memory that a particular JRE (Java Runtime Environment) gives to the JVM (Java Virtual Machine) that it creates. The java.exe command on Windows, java on UNIX and beasvc.exe when running WebLogic as a Windows service is the JRE, and the JVM exists within the JRE’s memory space. The primary sources for monitoring the amount of memory that is in use within a JVM are the WebLogic Remote Console and the WebLogic logs.

To monitor the amount of the JVM heap size available and in use with the WebLogic Remote Console:

  1. Sign in to the WebLogic Remote Console.

  2. Click the Monitoring Tree tile, then select Environment, and then JVM Runtime, and then General.

  3. The General page includes the following information about the JVM heap size and other information:

    Field or Control Description

    Heap Free Current

    The current amount of memory (in bytes) that is available in the JVM heap.

    Heap Free Percent

    Percentage of the maximum memory that is free.

    Heap Size Current

    The current size (in bytes) of the JVM heap.

    Heap Size Max

    The maximum free memory that is configured for this JVM.

    Java VM Vendor

    The JVM vendor.

    Java Vendor

    The Java vendor.

    Java Version

    The Java version of the JVM.

    Java Vendor Version

    The vendor version of Java.

    OS Name

    The operating system on which the JVM is running.

    OS Version

    The version of the operating system on which the JVM is running.

    Process Cpu Load

    CPU load.

Changing the JVM Heap Size

If you need to adjust any of the Java options, most commonly the JVM heap size, you must manually edit that WebLogic domain’s local setEnv script. The parameters, -Xms and -Xmx, control the JVM memory minimum and maximum heap size respectively.

See the following reference for examples of the JVM heap size as specified in setEnv using the JAVA_OPTIONS_OSplatform environment variable. You only need to set the variables that correspond to the operating system where the WebLogic server is running.

See Adjusting the JVM Heap Size.

Note:

If you do adjust any of the Java options, most commonly the JVM heap size, you must restart WebLogic for these changes to take effect.

If you're running WebLogic Server as a Windows service you must rerun the installNTservice script to propagate this change into the Windows registry.

The WebLogic Node Manager does not use the Java options set in setEnv, but instead uses Java options set from the WebLogic console.

To modify the Java options for a WebLogic instance started from the WebLogic Node Manager:

  1. Sign in to the WebLogic Remote Console.

  2. Select Providers, and then Add Admin Server Connection Provider.

    Supply the name and password for the WebLogic administrator and the URL for the provider in this format: http://server:9999.

  3. Select the provider.

  4. Click the Edit Tree tile, then select Environment, and then Servers, and then PIA, and then Advanced, and then Node Manager.

  5. Update the Arguments field.

  6. Click Save.

    Click the Shopping Cart icon to check for pending changes and commit them if necessary.