From owner-freebsd-virtualization@freebsd.org Thu Jan 30 10:00:19 2020 Return-Path: Delivered-To: freebsd-virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85101233BA3 for ; Thu, 30 Jan 2020 10:00:19 +0000 (UTC) (envelope-from matt.churchyard@userve.net) Received: from smtp-a.userve.net (smtp-outbound.userve.net [217.196.1.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.userve.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487bSf1nknz3Qx6 for ; Thu, 30 Jan 2020 10:00:17 +0000 (UTC) (envelope-from matt.churchyard@userve.net) Received: from owa.usd-group.com (owa.usd-group.com [217.196.1.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-a.userve.net (Postfix) with ESMTPS id 6FA4E238531 for ; Thu, 30 Jan 2020 10:00:15 +0000 (GMT) Received: from SERVER.ad.usd-group.com (192.168.0.1) by SERVER.ad.usd-group.com (192.168.0.1) with Microsoft SMTP Server (TLS) id 15.0.847.32; Thu, 30 Jan 2020 10:00:14 +0000 Received: from SERVER.ad.usd-group.com ([fe80::b19d:892a:6fc7:1c9]) by SERVER.ad.usd-group.com ([fe80::b19d:892a:6fc7:1c9%12]) with mapi id 15.00.0847.030; Thu, 30 Jan 2020 10:00:14 +0000 From: Matt Churchyard To: "freebsd-virtualization@freebsd.org" Subject: System (ps/top) & bhyvectl memory usage differences Thread-Topic: System (ps/top) & bhyvectl memory usage differences Thread-Index: AdXXUr8CnSPM2mjTR0WY55/xCMPKIQ== Date: Thu, 30 Jan 2020 10:00:13 +0000 Message-ID: <2fc4d1eaa382463a9799dd6214aa77ef@SERVER.ad.usd-group.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.0.10] MIME-Version: 1.0 X-Rspamd-Queue-Id: 487bSf1nknz3Qx6 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.71 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[userve.net:s=uk1]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:217.196.1.0/24]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[userve.net:+]; DMARC_POLICY_ALLOW(-0.50)[userve.net,reject]; RCVD_IN_DNSWL_NONE(0.00)[22.1.196.217.list.dnswl.org : 127.0.10.0]; TO_DN_EQ_ADDR_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:20652, ipnet:217.196.0.0/20, country:GB]; IP_SCORE(-3.71)[ip: (-9.73), ipnet: 217.196.0.0/20(-4.87), asn: 20652(-3.89), country: GB(-0.08)] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jan 2020 10:00:19 -0000 Hello, Is there a reason why the resident memory used by a bhyve guest is quite di= fferent when comparing ps/top & bhyvectl? Does bhyvectl take in account something in kernel space that top/ps doesn't= see? USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND root 12670 0.1 1.4 2120984 951764 1 SC+ 22Jan20 157:29.22 bhyve: smtp-= a (bhyve) # bhyvectl --get-stats --vm=3Dsmtp-a | grep Res Resident memory 1439875072 1.4G vs 925M ----- Another thing I've just remembered, which is probably unrelated to the abov= e but still concerning memory. I have a guest with 2G memory allocated, and dmesg lists 2048MB real memory= . The real & avail figures are also quite close which resembles the output = I generally expect on real hardware. Hypervisor: Origin =3D "bhyve bhyve " real memory =3D 2147483648 (2048 MB) avail memory =3D 2043318272 (1948 MB) However, I have a guest with 5G allocated, and get the following in dmesg - Hypervisor: Origin =3D "bhyve bhyve " real memory =3D 6442450944 (6144 MB) avail memory =3D 5141663744 (4903 MB) bhyveload -m 5G ... bhyve -c 2 -m 5G -AHP ... I haven't tested where it seems to change. My only theory is that it could = possibly be something to do with crossing the old 32bit limit? Regards, Matt Churchyard