SapMachine, a downstream distribution of OpenJDK, has launched a brand new monitoring instrument, SapMachine Vitals, that retains a condensed historical past of working system and JVM statistics. . The monitoring function is activated by default and could also be used to retrieve info similar to heap utilization, metaspace dimension, container reminiscence statistics and limits, the variety of courses loaded and the quantity of threads spawned.
Vitals is a mix of sysstat working system instruments and Java Digital Machine (JVM) statistics. The info is retrieved each ten seconds, by default, and buffered for ten days contained in the JVM. The buffer accommodates extra detailed details about the final hour. Whereas the overhead of Vitals is comparatively low with about 300 Kb of reminiscence consumption and little CPU consumption, it is nonetheless attainable to disable the function with the -XX:-EnableVitals
command.
The jcmd <pid> VM.vitals
command could also be used to create the report for a operating software. The report can also be a part of the hs_err_pid.log which the JVM generates as a part of an irregular exit. Lastly, when the JVM is began with the -XX:+PrintVitalsAtExit
argument, the Vitals report is printed to stdout earlier than the exit is accomplished. Alternatively, the -XX:+DumpVitalsAtExit
argument could also be used to create the next recordsdata: sapmachine_vitals_pid.txt and sapmachine_vitals_pid.csv. The names of the recordsdata could also be custom-made with the argument -XX:VitalsFile=<custom-filename>
.
The varied suboptions of VM.vitals
are displayed with the assist
argument:
jcmd 11818 assist VM.vitals
…
Choices: (choices have to be specified utilizing the <key> or <key>=<worth> syntax)
scale : [optional] Reminiscence utilization through which to scale. Legitimate values are: okay, m, g
(fastened scale) or "dynamic" for a dynamically chosen scale. (STRING, dynamic)
csv : [optional] csv format. (BOOLEAN, false)
no-legend : [optional] Omit legend. (BOOLEAN, false)
reverse : [optional] Reverse printing order. (BOOLEAN, false)
uncooked : [optional] Print uncooked values. (BOOLEAN, false)
now : [optional] Pattern now values (BOOLEAN, false)
The Vitals report has three subsections: system together with container stats, course of stats and JVM stats. Every subsection accommodates an inventory of the metrics and their abbreviations and on the finish of the report every metric is listed in a column and the measurements are displayed within the rows. So as to enhance readability, we mix the metrics and measurements on this article per subsection from the jcmd 11818 VM.vitals
command.
First the record of system and container metrics and their corresponding abbreviations is displayed:
------------system------------
avail: Reminiscence out there with out swapping [host] [krn]
comm: Dedicated reminiscence [host]
crt: Dedicated-to-Commit-Restrict ratio (p.c) [host]
swap: Swap house used [host]
si: Variety of pages swapped in [host] [delta]
so: Variety of pages pages swapped out [host] [delta]
p: Variety of processes
t: Variety of threads
tr: Variety of threads operating
tb: Variety of threads blocked on disk IO
cpu-us: CPU person time [host]
cpu-sy: CPU system time [host]
cpu-id: CPU idle time [host]
cpu-st: CPU time stolen [host]
cpu-gu: CPU time spent on visitor [host]
cgroup-lim: cgroup reminiscence restrict [cgrp]
cgroup-slim: cgroup reminiscence gentle restrict [cgrp]
cgroup-usg: cgroup reminiscence utilization [cgrp]
cgroup-kusg: cgroup kernel reminiscence utilization (cgroup v1 solely) [cgrp]
The measurements associated to the system and container metrics:
---------------------------------system----------------------------------
-----cpu------ -----cgroup------
avail comm crt swap si so p t tr tb us sy id st gu lim slim usg kusg
2023-02-14 19:51:57 25,7g 11,4g 64 0k 0 0 305 804 1 0 3 1 95 0 0 0k 64m
2023-02-14 19:51:47 25,7g 11,4g 64 0k 0 0 304 802 5 0 5 1 94 0 0 0k 64m
2023-02-14 19:51:37 25,7g 11,3g 64 0k 0 0 304 800 2 0 5 2 92 0 0 0k 64m
2023-02-14 19:51:27 25,7g 11,4g 64 0k 0 0 305 800 4 0 5 2 92 0 0 0k 64m
2023-02-14 19:51:17 25,7g 11,4g 64 0k 0 0 305 804 2 0 9 2 88 0 0 0k 64m
2023-02-14 19:51:07 23,8g 13,4g 76 0k 308 915 2 0 0k 26m
The record of course of metrics and their corresponding abbreviations is displayed:
-----------process------------
virt: Digital dimension
rss-all: Resident set dimension, whole
rss-anon: Resident set dimension, nameless reminiscence [krn]
rss-file: Resident set dimension, file mappings [krn]
rss-shm: Resident set dimension, shared reminiscence [krn]
swdo: Reminiscence swapped out
cheap-usd: C-Heap, in-use allocations (could also be unavailable if RSS > 4G) [glibc]
cheap-free: C-Heap, bytes in free blocks (could also be unavailable if RSS > 4G) [glibc]
cpu-us: Course of cpu person time
cpu-sy: Course of cpu system time
io-of: Variety of open recordsdata
io-rd: IO bytes learn from storage or cache
io-wr: IO bytes written
thr: Variety of native threads
The measurements associated to the method metrics:
--------------------------process--------------------------
-------rss------- -cheap-- -cpu- ----io-----
virt all anon file shm swdo usd free us sy of rd wr thr
10,9g 85m 50m 35m 0k 0k 24m 9m 0 0 6 76k 0k 20
10,9g 85m 50m 35m 0k 0k 24m 9m 0 0 6 76k 0k 20
10,9g 85m 50m 35m 0k 0k 24m 9m 0 0 6 76k 0k 20
10,9g 85m 50m 35m 0k 0k 24m 9m 0 0 6 76k 0k 20
10,9g 85m 50m 35m 0k 0k 24m 9m 1 0 6 724k <1k 20
10,6g 36m 12m 24m 0k 0k 21m 2m 5 18
The record of JVM metrics and their corresponding abbreviations is displayed:
-------------jvm--------------
heap-comm: Java Heap Measurement, dedicated
heap-used: Java Heap Measurement, used
meta-comm: Meta House Measurement (class+nonclass), dedicated
meta-used: Meta House Measurement (class+nonclass), used
meta-csc: Class House Measurement, dedicated [cs]
meta-csu: Class House Measurement, used [cs]
meta-gctr: GC threshold
code: Code cache, dedicated
nmt-mlc: Reminiscence malloced by hotspot [nmt]
nmt-map: Reminiscence mapped by hotspot [nmt]
nmt-gc: NMT "gc" (GC-overhead, malloc and mmap) [nmt]
nmt-oth: NMT "different" (sometimes DBB or Unsafe.allocateMemory) [nmt]
nmt-ovh: NMT overhead [nmt]
jthr-num: Variety of java threads
jthr-nd: Variety of non-demon java threads
jthr-cr: Threads created [delta]
jthr-st: Whole reserved dimension of java thread stacks [nmt] [linux]
cldg-num: Classloader Information
cldg-anon: Nameless CLD
cls-num: Courses (occasion + array)
cls-ld: Class loaded [delta]
cls-uld: Courses unloaded [delta]
The measurements associated to the JVM metrics:
----------------------------------jvm----------------------------------
--heap--- ---------meta---------- --jthr--- --cldg-- -----cls-----
comm used comm used csc csu gctr code num nd cr num anon num ld uld
508m 23m 9m 9m 1m 1m 21m 7m 11 1 0 36 32 2515 0 0
508m 23m 9m 9m 1m 1m 21m 7m 11 1 0 36 32 2515 0 0
508m 23m 9m 9m 1m 1m 21m 7m 11 1 0 36 32 2515 0 0
508m 23m 9m 9m 1m 1m 21m 7m 11 1 0 36 32 2515 0 0
508m 23m 9m 9m 1m 1m 21m 7m 11 1 2 36 32 2515 1841 0
508m 6m 448k 217k 128k 5k 21m 7m 11 1 4 1 674
The Vitals function is simply out there as a part of the SapMachine builds of OpenJDK. Thomas Stuefe, JVM engineer at SAP, indicated that the function was not accepted upstream as its options overlap with Java Flight Recorder. Extra info might be discovered on GitHub and within the SapMachine Vitals weblog.