Enabling Garbage Collection Monitoring on the WebLogic Server 9 (and above)

If the JVMGC test is to be executed for garbage collection (GC) monitoring, then the following additional steps need to be performed:

  1. Edit the startWebLogic.cmd file (in Windows. In Unix, this will be startWebLogic.sh) in the <ORACLE_HOME>\user_projects\domains\base_domain\<YOUR_DOMAIN> directory (on WebLogic Server ver. 10.3).

    jvmgctestonwl103

    Figure 1 : Adding entries for redireting GC output

  2. In the file, the 'echo' command to start the WebLogic server exists. Add -verbose:gc to the line next to this command, as indicated by Figure 1.
  3. Similarly, you will find an 'echo' command that will redirect the output from the WL window to a log file. Add the -verbose:gc entry to the line next to this command as well (as indicatd by Figure 1).
  4. Then, save the file.

    jvmgctestonwl103(1)

    Figure 2 : Specifying the path to the log file that will store the GC output

  5. Next, edit the startscript.xml file in the <ORACLE_HOME>\user_projects\domains\base_domain\init-info directory (on WebLogic ver. 10.3) to configure the location of the log file which should store the GC output. For this purpose, look for the entry <operand value="%WLS_REDIRECT_LOG%"> in the file. Once you locate this entry, you will find that another operand value parameter appears below it, but this parameter is left blank by default. Fill up this blank by specifying the full path to the log file in which the GC output is to be stored, as indicated by Figure 2.
  6. Finally, save the file.