Date: Sun, 4 Feb 2018 05:44:17 +0700 From: Eugene Grosbein <eugen@grosbein.net> To: Brandon Allbery <allbery.b@gmail.com>, Mark Millard <marklmi26-fbsd@yahoo.com> Cc: FreeBSD-STABLE Mailing List <freebsd-stable@freebsd.org> Subject: Re: 50 percent swap used, but "ps auxww" output shows no processes swapped out Message-ID: <5A763B41.2070700@grosbein.net> In-Reply-To: <CAKFCL4UYkdzXYLg1FeY_fd5eMhv-d29cL_eqfLgF6vOa2SANtw@mail.gmail.com> References: <4AF9AE33-887E-43F3-8885-B8EF37185407@yahoo.com> <CAKFCL4UYkdzXYLg1FeY_fd5eMhv-d29cL_eqfLgF6vOa2SANtw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
04.02.2018 5:32, Brandon Allbery wrote: > Also worth noting is that likely candidates for such pageouts include > long-lived daemons that are only needed, or which only need certain pages, > during startup/shutdown. So evicting only those pages to swap allows > optimal use of memory that would otherwise be wasted unnecessarily. > > Studying demand paging and unified page management is worth the effort. > Modern OSes, including Windows, make heavy use of this to optimize memory > usage --- but it means that old-style notions of process memory usage will > leave you wondering how the numbers make any sense. (I see this quite a > lot; most people still seem to think the basic unit of memory management is > a process, not a memory page, despite unified page management being over a > decade old and basic demand paging going back to 4BSD days.) FreeBSD kernel does not try to "swapout" even long-lived sleeping daemons as a whole when it needs some free pages. Even if it needs to free more pages by paging out some of them, it tries to minimize such I/O operations by default and writes only minimal necessary amount of pages keeping the rest intact, when vm.swap_idle_enabled=0.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5A763B41.2070700>