From fb4754735a456928de94c30ae8f10b15b654564a Mon Sep 17 00:00:00 2001 From: sevan Date: Sun, 25 Mar 2018 01:33:51 +0000 Subject: [PATCH] MFC r322665 Add caveat to kinfo_getvmmap(3) explaining high CPU utilisation. Based on kib's reply on https://lists.freebsd.org/pipermail/freebsd-hackers/2016-July/049710.html git-svn-id: svn://svn.freebsd.org/base/stable/10@331517 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- lib/libutil/kinfo_getvmmap.3 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/libutil/kinfo_getvmmap.3 b/lib/libutil/kinfo_getvmmap.3 index c6a13700a..134b20a56 100644 --- a/lib/libutil/kinfo_getvmmap.3 +++ b/lib/libutil/kinfo_getvmmap.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2015 +.Dd August 18, 2017 .Dt KINFO_GETVMMAP 3 .Os .Sh NAME @@ -58,6 +58,13 @@ with the mib. While the kernel returns a packed structure, this function expands the data into a fixed record format. +.Sh CAVEAT +.Fn kinfo_getvmmap +calls can cause significant CPU consumption because calculating the residency +counts requires iterating over all memory pages of the process. +Setting the sysctl variable +.Va kern.proc_vmmap_skip_resident_count +to 1 prevents this calculation. .Sh RETURN VALUES On success the .Fn kinfo_getvmmap -- 2.42.0