Garbage-collection (GC) logging is a helpful diagnostic tool for troubleshooting a variety of issues that are related to the performance of SAS® Web Application Server instances. To enable GC logging for SAS Web Application Server on SAS 9.4 in Microsoft Windows or UNIX operating environments, complete the instructions below.
Note that there is a separate method for enabling this logging for SAS® 9.4M8 (TS1M8) and for SAS® 9.4M7 (TS1M7) and earlier releases. Be sure to follow the appropriate section below depending on your release.
To enable GC logging under UNIX, modify the setenv.sh file for the SAS Web Application Server instance for which you want to enable the logging. For example, to enable logging for SASServer1_1, modify the setenv.sh file that resides in the SAS-configuration-directory/LevN/Web/WebAppServer/SASServer1_1/bin directory.
To enable the garbage-collection logging, complete the following steps:
1. Add the following option within the double quotation marks of the JVM_OPTS="..." line in the setenv.sh file:
Note: Change the SAS-configuration-directory placeholder above to match the exact SAS configuration directory path for this environment. If you enable GC logging for a SAS Web Application Server other than SASServer1_1, change the SASServer1_1 above to match the applicable SAS Web Application Server instance (such as SASServer2_1, SASServer12_1, and so on).
2. Restart the SAS Web Application Server instance for which you modified the setenv.sh file so that the changes can take effect. For example, SASServer1_1 can be restarted individually with a command similar to the following:
3. The new gcSASServer1_1.log file should be located in the <SAS_CONFIG>/Lev1/Web/Logs/ directory.
To enable GC logging under Windows, modify the wrapper.conf file for the SAS Web Application Server for which you want to enable logging. For example, to enable logging for SASServer1_1, modify the wrapper.conf file that resides in the SAS-configuration-directory\LevN\Web\WebAppServer\SASServer1_1\conf folder.
To enable the garbage-collection logging, complete the following steps:
1. Locate the Java Virtual Machine (JVM) options that look similar to the following: wrapper.java.additional.XX=
Note: For each of the options, xx represents the next number in the sequence for the number of options that are listed.
2. After the last of these sequential JVM options, add the following new JVM option:
Change the xx placeholder to the next number in the sequence of the other JVM options in this file.
Change the SAS-configuration-directory placeholder above to match the exact SAS configuration directory path for this environment. If you enable GC logging for a SAS Web Application Server other than SASServer1_1, change the SASServer1_1 above to match the applicable SAS Web Application Server instance (such as SASServer2_1, SASServer12_1, and so on).
3. After making changes to the wrapper.conf file, you must rebuild the Windows Service for that SAS Web Application Server instance to pick up the changes. Follow the steps documented in Rebuild Windows Service for Each SAS Web Application Server Instance to rebuild the Windows Service, and then start up the SAS Web Application Server instance.
4. The new gcSASServer1_1.log file should be located in the <SAS_CONFIG>/Lev1/Web/Logs/ directory.
To enable GC logging under UNIX, you need to modify the setenv.sh file for the SAS Web Application Server instance for which you want to enable the logging. For example, to enable logging for SASServer1_1, modify the setenv.sh file that resides in the SAS-configuration-directory/LevN/Web/WebAppServer/SASServer1_1/bin directory.
To enable the GC logging, complete the following steps:
Replace that line with the following block of code:
Edit the following variables (which are in bold in the code above) as follows:
Set the CLUSTER= variable to the cluster number. For example, for SASServer1_1, set CLUSTER=1; for SASServer1_2, set CLUSTER=2; for SASServer12_5, set CLUSTER=5 (and so on).
Restart the SAS Web Application Server instance for which you modified the setenv.sh file so that the changes can take effect. Once you restart the application, the following new log files should be created:
SAS-configuration-directory/LevN/Web/Logs/gc*.log
SAS-configuration-directory/Lev/Web/Logs/ulimit*.log
To enable GC logging under Windows, modify the wrapper.conf file for the SAS Web Application Server for which you want to enable logging. For example, to enable logging for SASServer1_1, modify the wrapper.conf file that resides in the SAS-configuration-directory\LevN\Web\WebAppServer\SASServer1_1\conf folder.
To enable the garbage-collection logging, complete the following steps:
Note: For each of the options, xx represents the next number in the sequence for the number of options that are listed.
Edit the following items (which are in bold in the code above), as follows:
Set the set.SERVER= variable to the server number. For example, for SASServer1_1, set SERVER=01; for SASServer2_1, set SERVER=02; for SASServer12_1, set SERVER=12 (and so on).
For the wrapper.java.additional.XX = parameter, change xx to the next number in the sequence of the other JVM options in this file.
Restart the SAS Web Application Server for which you modified the wrapper.conf file for so that the changes can take effect. If you are using the February 15, 2022 release of SAS 9.4M7 or later, you must also rebuild the Windows Service for the SAS Web Application Server instance after making changes to the wrapper.conf file in order for the changes to be applied. Follow the steps documented in Rebuild Windows Service for Each SAS Web Application Server Instance to do that. Once you restart the application, the following new log file should be created: SAS-configuration-directory\LevN\Web\Logs\gc*.log
Note: In Windows environments of SAS 9.4M7 and earlier, the GC log is automatically overwritten each time that SAS Web Application Server restarts. There is no workaround for this issue. (This problem does not occur in UNIX environments.) So, to avoid losing important diagnostic information when this file is overwritten, you need to implement a backup utility. For a method to implement a backup utility, see SAS Note 59142, "Backing up garbage-collection (GC) log files in Microsoft Windows operating environments." This method does not apply to SAS 9.4M8 because the GC log automatically rolls over.