Enabling verbose garbage collection (verboseGC output) is often required when you diagnose issues with your web application server. This KB article explains how to enable verboseGC output for web application servers (Apache Tomcat, JBoss, IBM WebSphere, and Oracle WebLogic) as well as for SAS Remote Services.
This section explains how to enable verbose garbage collecting for Tomcat in Windows and UNIX operating environments/
Notes:
wrapper.java.additional.N=-XX:+PrintGCDetails wrapper.java.additional.N=-XX:+PrintGCDateStamps wrapper.java.additional.N=-XX:+PrintHeapAtGC wrapper.java.additional.N=-verbose:gc wrapper.java.additional.N=-Xloggc:SAS-configuration-directory\Levn\Web\WebAppServer\SASServern\logs\tomcatgc.log wrapper.java.additional.N=-XX:+HeapDumpOnOutOfMemoryError wrapper.java.additional.N=-XX:+UseGCLogFileRotation NOTE: This must be used with -Xloggc:<filename> wrapper.java.additional.N=-XX:NumberOfGCLogFiles=number-of-files NOTE: Must be >=1, default is 1 wrapper.java.additional.N=-XX:GCLogFileSize=50M NOTE: Default will be set to 512K. You can set it in MB.
Notes:
3. Restart your Tomcat application server.
For SAS 9.4: Navigate to SAS-configuration-directory/Levn/Web/WebAppServer/SASServern/bin and open the setenv.sh start-up script file.
Notes:
JAVA_OPTS="-Xms1024m -Xmx3096m -XX:PermSize=768m -XX:MaxPermSize=768m,,,,,,"
3. Append the following parameters, in a continuous line, to the end of the existing JAVA_OPTS= parameters. Do NOT remove any of the existing parameters, and leave a space between each parameter.
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -verbose:gc -XX:+HeapDumpOnOutOfMemoryError -Xloggc:SAS-configuration-directory/Levn/Web/WebAppServer/SASServern/logs/tomcatgc.log -XX:+UseGCLogFileRotation NOTE: This must be used with -Xoggc:filename -XX:NumberOfGCLogFiles=number-of-files NOTE: Must be >=1, default is 1 -XX:GCLogFileSize=50M NOTE: Default will be set to 512K. You can set it in MB.
4. Restart the Tomcat application server.
For SAS 9.4: Navigate to SAS-configuration-directory/Levn/Web/WebAppServer/SASServern/bin and open the setenv.sh start-up script file.
Notes:
2. In the SASServern.sh or setenv.sh script, locate the following JAVA_OPTS= environment variable:
JAVA_OPTS="-Xms1024m -Xmx3096m -XX:PermSize=768m -XX:MaxPermSize=768m,,,,,,"
3. Append the following parameters, in a continuous line, to the end of the existing JAVA_OPTS= parameters. Do NOT remove any of the existing parameters, and leave a space between each parameter.
4. Restart the Tomcat application server.
Note: SASServern specifies your particular server (for example, SASServer1, SASServer2, and so on).
wrapper.java.additional.N=-XX:+PrintGCDetails wrapper.java.additional.N=-XX:+PrintGCDateStamps wrapper.java.additional.N=-verbose:gc wrapper.java.additional.N=-Xloggc:JBoss-home-directory\server\SASServern\log\jbossgc.log wrapper.java.additional.N=-XX:+HeapDumpOnOutOfMemoryError wrapper.java.additional.N=-XX:+PrintHeapAtGC wrapper.java.additional.N=-XX:+UseGCLogFileRotation NOTE: This must be used with -Xloggc:<filename> wrapper.java.additional.N=-XX:NumberOfGCLogFiles=number-of-files NOTE: Must be >=1, default is 1 wrapper.java.additional.N=-XX:GCLogFileSize=50M NOTE: Default will be set to 512K. You can set it in MB.
Notes:
3. Restart the JBoss application server (in this case, SASServern).
Note: SASServern specifies your particular server (for example, SASServer1, SASServer2, and so on).
wrapper.java.additional.N=-verbosegc wrapper.java.additional.N=-Xverbosegclog:JBoss-home-directory\server\SASServern\log\jbossgc.log
Notes:
3. Restart the JBoss application server (in this case, SASServern).
JAVA_OPTS="-Xms1024m -Xmx3096m -XX:PermSize=768m -XX:MaxPermSize=768m,,,,,,"
Notes:
3. Append the following parameters, in a continuous line, to the end of the existing JAVA_OPTS= parameters. Do NOT remove any of the existing parameters, and leave a space between each parameter.
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -verbose:gc -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError -Xloggc:JBoss-home-directory/server/SASServern/log/jbossgc.log -XX:+UseGCLogFileRotation NOTE: This must be used with -Xloggc:<filename> -XX:NumberOfGCLogFiles=number-of-files NOTE: Must be >=1, default is 1 -XX:GCLogFileSize=50M NOTE: Default will be set to 512K. You can set it in MB.
4. Restart the JBoss Server (in this case, SASServern).
Notes:
JAVA_OPTS="-Xms1024m -Xmx3096m -XX:PermSize=768m -XX:MaxPermSize=768m,,,,,,"
3. Append the following parameters, in a continuous line, to the end of the existing JAVA_OPTS= parameters. Do NOT remove any of the existing parameters, and leave a space between each parameter.
-verbosegc -Xverbosegclog:JBoss-home-directory/server/SASServern/log/jbossgc.log
4. Restart the JBoss Server (in this case, SASServern).
**Important Note:
For Solaris or HP-UX operating environments on WebSphere Application Server 7.0 (Java 6) or later, you also need to complete the following additional steps before you save your changes and restart the application server:
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC
Note: The -XX:+PrintHeapAtGC parameter generates a large amount of logging to the native_stdout.log file. Therefore, you need to ensure that you have adequate file-system space when you enable this parameter. All of the information that is produced by this parameter is known to the Java Virtual Machine (JVM). Therefore, enabling the parameter does not require any extra processing. However, a slight amount of additional I/O overhead (amounting to less than 3%) does occur.
6. Return to the previous instructions and complete steps 5 and 6.
**Important Note:
For Solaris or HP-UX operating environments on WebSphere Application Server 7.0 (Java 6) or later, you also need to complete the following additional steps before you save your changes and restart the application server:
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC
Note: The -XX:+PrintHeapAtGC parameter generates a large amount of logging to the native_stdout.log file. Therefore, you need to ensure that you have adequate file-system space when you enable this parameter. All of the information that is produced by this parameter is known to the Java Virtual Machine (JVM). Therefore, enabling the parameter does not require any extra processing. However, a slight amount of additional I/O overhead (amounting to less than 3%) does occur.
6. Return to the previous instructions and complete steps 5 and 6.
Perform the following steps for any problematic SAS servers (for example, SASServer1, SASServer2, . . .SASServern) that you have configured in your environment.
-verbose:gc -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCDateStamps -Xloggc:EBIServer-home-directory/Levn/Web/Logs/SASServern_gc.log -XX:+PrintClassHistogram -XX:+HeapDumpOnOutOfMemoryError -XX:+UseGCLogFileRotation NOTE: This must be used with -Xloggc:<filename> -XX:NumberOfGCLogFiles=number-of-files NOTE: Must be >=1, default is 1 -XX:GCLogFileSize=50M NOTE: Default will be set to 512K. You can set it in MB.
Notes:
Perform the following steps for any problematic SAS servers (for example, SASServer1, SASServer2, . . .SASServern) that you have configured in your environment.
-verbosegc -Xverbosegclog:EBIServer-home-directory/Levn/Web/Logs/SASServern_gc.log
Notes:
4. Click Save to save your changes.
5. Apply the changes by clicking Activate Changes.
6. Restart WebLogic in order for the changes to take effect.
Notes:
3. In the wrapper.conf file, locate the section named # This numbering starts at the endpoint of the including wrapper.conf and add the following Java parameters:
wrapper.java.additional.N=-XX:+PrintGCDetails wrapper.java.additional.N=-XX:+PrintGCDateStamps wrapper.java.additional.N=-verbose:gc wrapper.java.additional.N=-Xloggc:SAS-configuration-file\Levn\Web\Logs\remoteServicesGC.log wrapper.java.additional.N=-XX:+HeapDumpOnOutOfMemoryError wrapper.java.additional.N=-XX:+PrintHeapAtGC wrapper.java.additional.N=-XX:+UseGCLogFileRotation NOTE: This must be used with -Xloggc:<filename> wrapper.java.additional.N=-XX:NumberOfGCLogFiles=number-of-files NOTE: Must be >=1, default is 1 wrapper.java.additional.N=-XX:GCLogFileSize=50M NOTE: Default will be set to 512K. You can set it in MB.
Note: In the wrapper.java.additional.N= parameter, N specifies the actual number of your wrapper parameter.
4. Start SAS Remote Services.
Windows Operating Environments Using an IBM JDK or JRE
Notes:
wrapper.java.additional.N=-verbosegc wrapper.java.additional.N=-Xverbosegclog:SAS-configuration-file\Levn\Web\Logs\remoteServicesGC.log
Note: In the wrapper.java.additional.N= parameter, N specifies the actual number of your wrapper parameter.
4. Start SAS Remote Services.
UNIX Operating Environments Using a SUN JDK or JRE
Notes:
start2) "$JAVA_JRE_COMMAND" -Dsas.ext.config="/opt/sas93/install/sas.java.ext.config" \ -classpath "CLASSPATH" \ -Djava.system.class.loader=com.sas.app.AppClassLoader -Dsas.app.launch.config="$MERGER_PICKLIST" \ -Dsas.app.repository.path="$SASVJR_REPOSITORYPATH" \ -Dsas.app.class.path="$REMOTESERVICESDIR" \ com.sas.framework.picklist.PicklistMerger \ -primary "$PRIMARY_PICKLIST" \ "$PICKLIST" \ "$SECONDARY_PICKLIST1" \ "$SECONDARY_PICKLIST2" cd $REMOTESERVICESLOGSDIR nohup "$JAVA_JRE_COMMAND" -Dsas.ext.config="/opt/sas93/install/sas.java.ext.config" \ -classpath "$CLASSPATH" \ -Dlog4j.configuration=file:////opt/sas93/config/Lev1/Web/Applications/RemoteServices/log4j.xml \ -Djava.system.class.loader=com.sas.app.AppClassLoader \ -Dsas.app.launch.config="$PICKLIST" \ -Dsas.app.repository.path="$SASVJR_REPOSITORYPATH" \ -Dsas.app.class.path="$REMOTESERVICESDIR" \ -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false -Dmulticast_udp_ip_ttl=1 \ -Dsas.vjr.dir="$SASVJR_REPOSITORYPATH" -Dsas.lev.dir="$LEVEL_ROOT" -Dsas.home.dir="$SAS_HOME" \ -Dsas.services.information.types.path="/opt/sas93/install/SASPlatformObjectFramework/9.3/plugins" \ -Dsas.vm.identifier=Lev1:5091 \ -Xms256m -Xmx256m -Xgcpolicy:gencon -Xdisableexplicitgc -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.awt.headless=true -Xss256k -Xmso256k -Xmn16m \ com.sas.framework.services.bootstrap.SASRemoteServices > \ $REMOTESERVICESLOGSDIR/RemoteServices_console.log
4. Append the following parameters, in a continuous line, to the end of the existing start2) sections. Do NOT remove any of the existing parameters, and leave a space between each parameter.
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -verbose:gc -XX:+HeapDumpOnOutOfMemoryError -Xloggc:SAS-configuration-directory/Levn/Web/Logs/remoteServicesGC.log -XX:+UseGCLogFileRotation NOTE: This must be used with -Xloggc:<filename> -XX:NumberOfGCLogFiles=number-of-files NOTE: Must be >=1, default is 1 -XX:GCLogFileSize=50M NOTE: Default will be set to 512K. You can set it in MB.
5. Start SAS Remote Services.
Notes:
start2) "$JAVA_JRE_COMMAND" -Dsas.ext.config="/opt/sas93/install/sas.java.ext.config" \ -classpath "CLASSPATH" \ -Djava.system.class.loader=com.sas.app.AppClassLoader -Dsas.app.launch.config="$MERGER_PICKLIST" \ -Dsas.app.repository.path="$SASVJR_REPOSITORYPATH" \ -Dsas.app.class.path="$REMOTESERVICESDIR" \ com.sas.framework.picklist.PicklistMerger \ -primary "$PRIMARY_PICKLIST" \ "$PICKLIST" \ "$SECONDARY_PICKLIST1" \ "$SECONDARY_PICKLIST2" cd $REMOTESERVICESLOGSDIR nohup "$JAVA_JRE_COMMAND" -Dsas.ext.config="/opt/sas93/install/sas.java.ext.config" \ -classpath "$CLASSPATH" \ -Dlog4j.configuration=file:////opt/sas93/config/Lev1/Web/Applications/RemoteServices/log4j.xml \ -Djava.system.class.loader=com.sas.app.AppClassLoader \ -Dsas.app.launch.config="$PICKLIST" \ -Dsas.app.repository.path="$SASVJR_REPOSITORYPATH" \ -Dsas.app.class.path="$REMOTESERVICESDIR" \ -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false -Dmulticast_udp_ip_ttl=1 \ -Dsas.vjr.dir="$SASVJR_REPOSITORYPATH" -Dsas.lev.dir="$LEVEL_ROOT" -Dsas.home.dir="$SAS_HOME" \ -Dsas.services.information.types.path="/opt/sas93/install/SASPlatformObjectFramework/9.3/plugins" \ -Dsas.vm.identifier=Lev1:5091 \ -Xms256m -Xmx256m -Xgcpolicy:gencon -Xdisableexplicitgc -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.awt.headless=true -Xss256k -Xmso256k -Xmn16m \ com.sas.framework.services.bootstrap.SASRemoteServices > \ $REMOTESERVICESLOGSDIR/RemoteServices_console.log
4. Append the following parameters, in a continuous line, to the end of the existing start2) sections. Do NOT remove any of the existing parameters, and leave a space between each parameter.
-verbosegc -Xverbosegclog:SAS-configuration-directory/Levn/Web/Logs/remoteServicesGC.log
5. Start SAS Remote Services.