How does Linux turn on the GC settings for logs in tomcat?

Time:2019-10-7

In order to monitor the long-term change of GC in the process of testing system pressure, it is necessary to configure relevant GC input logs in Tomcat for subsequent analysis of gc. So how to open the GC settings of logs in tomcat?

1. Enter the directory of Tomcat bin, in the commandvi catalina.shTo edit

2. Then add the

JAVA_OPTS=”-Xms128m -Xmx256m -Xmn100m -XX:MaxPermSize=30m -Xloggc:/usr/local/tomcat/logs/gc.$$.log”

3. After the GC is turned on, as long as Tomcat is started, it can be generated in the directory.The log content of gc.

4. In order to facilitate the analysis, it is necessary toGC logs in LinuxCopy to Windows native species.

5. OpenJ of hpjtunearFiles to analyze GC files.

6. OpenhpjtuneAfter that, click Open File.

7. Browse GC log filesAfter that,Click Open.

8. In this way, we can analyze the specific content of gc.

Relevant recommendations:

How does Linux install the Quick Thunder Edition?

How to use grep command in Linux system?

How does the LINUX system use commands to clean up disk space?