1. JPS get the process ID to monitor broker JVM
Jsp
2. Nohup Output Monitoring Log
Nohup JSTAT-GC-T [PID] [interval]
-T adds a timestamp before each record, executing the command interval interval (ms)
3. Ctrl + C When you want to end monitoring
4. View Logs
Cat Nohup.out
5. Get the process start time
6. Convert the time in the timestamp to the current time (unit s in the log)
For example, see the third record execution time
Public Static void throws parseexception { new SimpleDateFormat ("Yyyy-mm-dd hh:mm:ss"); = Df.parse ("2015-06-23 10:22:27"); = calendar.getinstance (); + 111919 * +); System.out.println (C.gettime ()); }
Results:
- +:
7. Analyze memory usage and garbage collection in logs
Timestamp |
s0c |
S1c |
s0u |
s1u |
EC |
EU |
Oc |
OU |
Pc |
Pu |
Ygc |
Ygct |
FGC |
Fgct |
GCT |
111916.9 |
209664.0 |
209664.0 |
160735.4 |
0.0 |
1677824.0 |
100273.5 |
2097152.0 |
898708.6 |
131072.0 |
15537.9 |
68 |
15.477 |
0 |
0.000 |
15.477 |
garbage-collected Heap statistics.
Timestamp:timestamp (s).
s0c Current survivor Space 0 capacity (KB).
S1ccurrent survivor Space 1 Capacity (KB).
S0usurvivor Space 0 Utilization (KB).
S1usurvivor Space 1 Utilization (KB).
eccurrent Eden Space Capacity (KB).
Eueden Space Utilization (KB).
occurrent old space Capacity (KB).
ouold Space Utilization (KB).
Pccurrent Permanent Space Capacity (KB).
pupermanent Space Utilization (KB).
Ygcnumber of young Generation GC Events.
Ygctyoung Generation garbage collection time.
Fgcnumber of Full GC events.
Fgctfull garbage collection time.
Gcttotal garbage collection time.
ROCKETMQ Broker JVM Monitoring