@@ -19,16 +19,23 @@ Suite.
19
19
Run the following command with a ** normal** user (* not* as ` root ` or using ` sudo ` ):
20
20
21
21
``` shell
22
- ./capture.py -e 50 -m /path/to/libmmtk_openjdk.so --no-root-nodes
22
+ ./capture.py -e 47 -m /path/to/libmmtk_openjdk.so --no-root-nodes
23
23
```
24
24
25
- ` -e 50 ` means we only capture one GC in every 50 GCs because otherwise it will have to print too
25
+ ` -e 47 ` means we only capture one GC in every 47 GCs because otherwise it will have to print too
26
26
much log. (Note: Printing in bpftrace is done via a fixed-size user/kernel space buffer, therefore
27
27
excessive printing will overrun the buffer and cause events to be dropped. The ` -e ` option helps
28
28
reducing the volume of log, thereby reducing the likelihood of buffer overrun and the time for
29
29
post-processing. If one single GC still produces too much log and overruns the buffer, the user
30
30
should consider setting the ` BPFTRACE_PERF_RB_PAGES ` environment variable. See the man page of
31
- ` bpftrace ` .)
31
+ ` bpftrace ` .) We choose a large prime number, such as 47, because some GCs may exhibit periodic
32
+ behaviors under certain workloads. For example, generational GCs may alternate between nursery and
33
+ full-heap GC, making every odd GC a nursey GC, and every even GC a full-heap GC. If we capture
34
+ every 50th GC, we will only observe even or odd GCs because 50 is an even number, and it will give
35
+ us an illusion of "all GCs are nursery GC" or "all GCs are full-heap GC". This is an instance of
36
+ [ aliasing effect] .
37
+
38
+ [ aliasing effect ] : https://en.wikipedia.org/wiki/Aliasing
32
39
33
40
` --no-root-nodes ` skips the ` process_root_nodes ` USDT which does not exist in ` libmmtk_openjdk.so ` .
34
41
@@ -86,7 +93,7 @@ This means things are working properly. Now re-run `./capture.py` again, but pi
86
93
file.
87
94
88
95
```
89
- ./capture.py -m /path/to/libmmtk_openjdk.so --no-root-nodes > mybenchmark.log
96
+ ./capture.py -e 47 - m /path/to/libmmtk_openjdk.so --no-root-nodes > mybenchmark.log
90
97
```
91
98
92
99
Type the root password if prompted.
0 commit comments