Now
MAIN commitmail json YAML
kmem(9): Create dtrace sdt probes for each kmem cache size.
The names of the probes correspond to the names shown in vmstat -m.
This should make it much easier to track down who's allocating memory
when there's a leak, e.g. by getting a histogram of stack traces for
the matching kmem cache pool:
# vmstat -m
Memory resource pool statistics
Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
...
kmem-00128 256 62242 0 0 3891 0 3891 3891 0 inf 0
...
# dtrace -n 'sdt:kmem:*:kmem-00128 { @[probefunc, stack()] = count() }'
^C
When there's no leak, the allocs and frees (probefunc) will be roughly
matched; when there's a leak, the allocs will far outnumber the frees.
The names of the probes correspond to the names shown in vmstat -m.
This should make it much easier to track down who's allocating memory
when there's a leak, e.g. by getting a histogram of stack traces for
the matching kmem cache pool:
# vmstat -m
Memory resource pool statistics
Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle
...
kmem-00128 256 62242 0 0 3891 0 3891 3891 0 inf 0
...
# dtrace -n 'sdt:kmem:*:kmem-00128 { @[probefunc, stack()] = count() }'
^C
When there's no leak, the allocs and frees (probefunc) will be roughly
matched; when there's a leak, the allocs will far outnumber the frees.