From owner-freebsd-stable@freebsd.org Tue Sep 22 17:40:51 2020 Return-Path: Delivered-To: freebsd-stable@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 A8F923F0FCB for ; Tue, 22 Sep 2020 17:40:51 +0000 (UTC) (envelope-from pmc@citylink.dinoex.sub.org) Received: from uucp.dinoex.sub.de (uucp.dinoex.sub.de [IPv6:2001:1440:5001:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "uucp.dinoex.sub.de", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BwpW60031z4MPM; Tue, 22 Sep 2020 17:40:49 +0000 (UTC) (envelope-from pmc@citylink.dinoex.sub.org) Received: from uucp.dinoex.sub.de (uucp.dinoex.org [185.220.148.12]) by uucp.dinoex.org (8.16.0.50/8.16.0.45) with ESMTPS id 08MHeWFM012362 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 22 Sep 2020 19:40:33 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) X-Authentication-Warning: uucp.dinoex.sub.de: Host uucp.dinoex.org [185.220.148.12] claimed to be uucp.dinoex.sub.de Received: (from uucp@localhost) by uucp.dinoex.sub.de (8.16.0.50/8.16.0.45/Submit) with UUCP id 08MHeWaV012361; Tue, 22 Sep 2020 19:40:32 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by citylink.dinoex.sub.de (8.15.2/8.15.2) with ESMTP id 08MHXdSN037634; Tue, 22 Sep 2020 19:33:39 +0200 (CEST) (envelope-from peter@gate.oper.dinoex.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by gate.oper.dinoex.org (8.15.2/8.15.2) with ESMTP id 08MHV8EN037325; Tue, 22 Sep 2020 19:31:08 +0200 (CEST) (envelope-from peter@gate.oper.dinoex.org) Received: (from peter@localhost) by gate.oper.dinoex.org (8.15.2/8.15.2/Submit) id 08MHV8JW037324; Tue, 22 Sep 2020 19:31:08 +0200 (CEST) (envelope-from peter) Date: Tue, 22 Sep 2020 19:31:07 +0200 From: Peter Sender: li-fbsd@citylink.dinoex.sub.org To: Mark Johnston Cc: freebsd-stable@freebsd.org Subject: Re: How to free used Swap-Space? Message-ID: <20200922173107.GA27670@gate.oper.dinoex.org> References: <20200922160801.GA19535@gate.oper.dinoex.org> <20200922163319.GA70673@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200922163319.GA70673@raichu> X-Milter: Spamilter (Reciever: uucp.dinoex.sub.de; Sender-ip: 185.220.148.12; Sender-helo: uucp.dinoex.sub.de; ) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (uucp.dinoex.org [185.220.148.12]); Tue, 22 Sep 2020 19:40:36 +0200 (CEST) X-Rspamd-Queue-Id: 4BwpW60031z4MPM X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of pmc@citylink.dinoex.sub.org has no SPF policy when checking 2001:1440:5001:1::2) smtp.mailfrom=pmc@citylink.dinoex.sub.org X-Spamd-Result: default: False [0.46 / 15.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.77)[-0.775]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.87)[-0.866]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[sub.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_SHORT(0.20)[0.199]; RCVD_COUNT_THREE(0.00)[4]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8469, ipnet:2001:1440::/32, country:DE]; SUBJECT_ENDS_QUESTION(1.00)[]; MAILMAN_DEST(0.00)[freebsd-stable] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2020 17:40:51 -0000 On Tue, Sep 22, 2020 at 12:33:19PM -0400, Mark Johnston wrote: ! On Tue, Sep 22, 2020 at 06:08:01PM +0200, Peter wrote: ! > my machine should use about 3-4, maybe 5 GB swapspace. Today I found ! > it suddenly uses 8 GB (which is worryingly near the configured 10G). ! > ! > I stopped all the big suckers - nothing found. ! > I stopped all the jails - no success. ! > I brought it down to singleuser: it tried to swapoff, but failed. ! > ! > I unmounted all filesystems, exported all pools, detached all geli, ! > and removed most of the netgraphs. Swap is still occupied. ! > ! > Machine is now running only the init and a shell processes, has ! > almost no filesystems mounted, has mostly native networks only, and ! > this still occupies 3 GB of swap which cannot be released. ! > ! > What is going on, what is doing this, and how can I get this swapspace ! > released?? ! ! Do you have any shared memory segments lingering? ipcs -a will show ! SysV shared memory usage. I have four small shmem segments from four postgres clusters running. These should cleanly disappear when the clusters are stopped, and they are very small. Shared Memory: T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME m 65536 5432001 --rw------- postgres postgres postgres postgres 7 48 4793 4793 6:09:34 18:00:31 6:09:34 m 65537 0 --rw------- postgres postgres postgres postgres 11 48 6268 6268 6:09:42 10:48:27 6:09:42 m 65538 0 --rw------- postgres postgres postgres postgres 5 48 6968 6968 6:09:46 18:28:36 6:09:46 m 65539 0 --rw------- postgres postgres postgres postgres 6 48 6992 6992 6:09:47 3:38:34 6:09:47 ! For POSIX shared memory, in 11.4 we do not ! have any good way of listing objects, but "vmstat -m | grep shmfd" will ! at least show whether any are allocated. There is something, and I don't know who owns that: $ vmstat -m | grep shmfd shmfd 13 14K - 473 64,256,1024,8192 But that doesn't look big either. Furthermore, this machine is running for quite some time already; it was running as i386 (with ZFS) until very recently, and I know quite well what is using much memory: these 3 GB were illegitimate; they came from nothing I did install. And they are new; this has not happened before. ! If those don't turn anything ! up then it's possible that there's a swap leak. Do you use any DRM ! graphics drivers on this system? Probably yes. There is no graphics used at all; it just uses "device vt" in text mode, but it uses i5-3570T CPU (IvyBridge HD2500) graphics for that, and the driver is "drm2" and "i915drm" from /usr/src/sys (not those from ports). Not sure how that would account for 3 GB, unless there is indeed some leak. regards, PMc