Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Nov 2018 16:59:48 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Wojciech Puchar <wojtek@puchar.net>, Rebecca Cran <rebecca@bluestop.org>
Cc:        freebsd-hackers Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: 13-CURRENT: several GB swap being used despite plenty of free RAM
Message-ID:  <1542499188.56571.59.camel@freebsd.org>
In-Reply-To: <alpine.BSF.2.20.1811172251090.60846@puchar.net>
References:  <1748688.u6MfGjpqfb@photon.int.bluestop.org> <alpine.BSF.2.20.1811172251090.60846@puchar.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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.
> > 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1542499188.56571.59.camel>