From owner-freebsd-hackers@freebsd.org Sun Nov 18 00:00:00 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E47D1110B52F for ; Sat, 17 Nov 2018 23:59:59 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D67D86B27 for ; Sat, 17 Nov 2018 23:59:59 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1542499184; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=u6G4ddPhcLAW2JkCpIq3nT0C/hRCyxXTG+pXZdHSdkOWPk8OB3MjJOox9hp3qXcOETrU8CegMlQJE LnujYaz+2svgLg2q2chOtlNWyuayU/XoJfve/NPrx4pT/xldSmbPwbn9nHmABq3AduWLtA+QnvxWt/ 4Ymk9AtzYHTg53d/s9T0KKZ8vaWjRwnOd1FxS23ld62nw3C7r4KtrsUxklrKPcc+4ACNYQUubiLcj4 ODftH72gMln5eaHbwrcf9Jj93Rw9GXTuwZrJejlSABjYtuapkcuF9w1IZV/4OXWNOs6GXcBnF5IlAt bqQulou7ewD04K6sowSIBaD5x6S7ffw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=veg/9AszBpH1+s+kmoTl6RFsFGteZl8Flcs4ZI1AfOc=; b=FkgzUH5glJrjjQtSrpDkt+w3zMX0ZLtmlYg9GnI8pwfLt6KbR8g8GHhFR283vX9ett6foeyi95cvr FMKur1f6bA4Q7uFmzIjfXhsmg2DGRJZ4VNG2nVTIMZKjhaiNPwqG6dx0WWJPtEnLwdbuqbUn6ft9V/ +rbwn+sSiLaHq59lSOToIr3nn0AdTpbMoP21vcipDLyR2ZmDhf99q71w7S2ap9at6aNw/bNJtm8hFW 6XnMJ2FetVMLW8wVFvpU8UGgY/G4SgzAOeZaNX8Pkk1/T+ZIZcvhdpgLykIWkpRx8Pv34OC3qK7o0k vejR2JXvCgsoW39UaLtgXmDalt1fsEg== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=veg/9AszBpH1+s+kmoTl6RFsFGteZl8Flcs4ZI1AfOc=; b=gQ0HyV/M4Iqt6gpcVWAYaWFeAkUYn9GCjPXjc+9pDhA/rX1nd6lMBfT8recN1pDmNT6wXhXZAsoYI LHOZew7f1NJARHNI2yM3Um032i6tk6x3GNhGxw22R7+cfgxZVOhiKWw+P93xqPD+Q+CtqKoQ96350t 0bx0XZWo+zxt2jLTF5WLI+2DQZtyE7NwXZG+Js6qsE2EvmNVo2NZhVm1/FxVSuCX5UpAGumk7syU5X ThutT7VxUtXuBfyt8R7zEt9ag6/KoAIBsOhvXFj4IJx9F+ArJJTnkrbUR/frwAJnTVf1l/hT6RxGs8 VIk9lcBcm9/UKEmS/yR5TsAJKI3uarQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: d94d7790-eac4-11e8-a59a-7b143e15dabc X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id d94d7790-eac4-11e8-a59a-7b143e15dabc; Sat, 17 Nov 2018 23:59:43 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id wAHNxmJi008501; Sat, 17 Nov 2018 16:59:48 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1542499188.56571.59.camel@freebsd.org> Subject: Re: 13-CURRENT: several GB swap being used despite plenty of free RAM From: Ian Lepore To: Wojciech Puchar , Rebecca Cran Cc: freebsd-hackers Hackers Date: Sat, 17 Nov 2018 16:59:48 -0700 In-Reply-To: References: <1748688.u6MfGjpqfb@photon.int.bluestop.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D67D86B27 X-Spamd-Result: default: False [-0.03 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_SHORT(-0.03)[-0.030,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:00:00 -0000 On Sat, 2018-11-17 at 22:52 +0100, Wojciech Puchar wrote: > freebsd will not swap with that lots of free ram. > but it's 90GB free NOW, how about before? > Your information is outdated. For at least a couple years now (since approximately the 10.1 - 10.2 timeframe is my vague estimate), freebsd will page out application memory that hasn't been referenced for some time, even when the system has no shortage of free memory at all. The advice I was recently given to revert to the old behavior is:   sysctl vm.pageout_update_period=0 I've been using it on a couple systems here for a few days now, and so far results are promising, I am no longer seeing gratuitous swapfile usage on systems that have so much free physical ram that they should never need to page anything out. I haven't yet pushed one of those systems hard enough to check what happens when they do need to start proactively paging out inactive memory due to shortages -- it could be that turning off the new behavior has downsides for some workloads. -- Ian >  > If something got swapped it isn't read back just because there is > free  > memory but when it will be needed. > On Sat, 17 Nov 2018, Rebecca Cran via freebsd-hackers wrote: > > > > > I'm running 13-CURRENT from a few days ago. I noticed the system > > using several > > GB of swap despite having 90GB RAM still free. I know FreeBSD will > > use *some*, > > but 3450MB seems excessive when there's still 90GB RAM free. > > > > CPU:  0.1% user,  0.0% nice,  0.0% system,  0.0% interrupt, 99.8% > > idle > > Mem: 3392M Active, 5489M Inact, 390M Laundry, 25G Wired, 90G Free > > ARC: 19G Total, 8080M MFU, 9242M MRU, 64K Anon, 197M Header, 1570M > > Other > >     15G Compressed, 26G Uncompressed, 1.73:1 Ratio > > Swap: 8192M Total, 3450M Used, 4742M Free, 42% Inuse, 36K In > > > > Quitting firefox caused the swap usage to drop to just 460MB. I > > don't > > understand why it would decide to swap out so much, especially > > since I have > > vm.swap_idle_enabled set to 0. > >