Date: Sun, 26 Jul 2020 11:38:24 -0400 From: Aryeh Friedman <aryeh.friedman@gmail.com> To: Victor Sudakov <vas@sibptus.ru> Cc: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: Ask stupid questions and you'll get a stupid answers, was: Technological advantages over Linux Message-ID: <CAGBxaXmbF-me=MZs13ywcAkXkTUaP-Hx3P5s%2BApTfojdJxiBSg@mail.gmail.com> In-Reply-To: <20200726151835.GA35966@admin.sibptus.ru> References: <CAEJNuHxC7i%2Bq7cq65=my6mJZDdiK4gpQsKjMU1nvsm=Ri4On%2Bg@mail.gmail.com> <ce61b5e9-b71c-e5b7-c64d-f79884c87435@watters.ws> <20200725152412.GJ92589@admin.sibptus.ru> <CAGBxaX=Ktr-pqtT8FU37ajkYonVLYT_WhSenn23Tj5b=i0d-8g@mail.gmail.com> <20200725162403.GA4721@admin.sibptus.ru> <CAGBxaXmBZcCWqAZFR9OSyRGrqGFU%2BqCAZ8CfOi=0oXAmf-2=tA@mail.gmail.com> <20200725182554.deffc63058a7c9f6d343ef06@sohara.org> <04df312d-9b2b-1873-2117-79a49e089bd9@kicp.uchicago.edu> <20200726063256.GA22924@admin.sibptus.ru> <20200726093909.ee5e14e643d31da4dad5c804@sohara.org> <20200726151835.GA35966@admin.sibptus.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 26, 2020 at 11:18 AM Victor Sudakov <vas@sibptus.ru> wrote: > Steve O'Hara-Smith wrote: > > > > > FreeBSD freezes, then kills some innocent random processes like > > > local_unbound, then it may slowly recover. Sometimes it guesses > > > correctly and kills the offender (firefox most often). > > > > What else would you have it do ? Kill the largest process ? Kill > > the last process to call malloc ? There is no good response to OOM. The > OS > > has no way to know which processes you care about most. > > AFAIK the Linux OOM killer uses multiple weighted criteria to decide > which process to kill. Each process has an oom_score showing its > eligibility to be killed. > > So at least Linux attemps intelligent killing. What about FreeBSD? > Every time a piece of software and/or algorithm attempts to be "intelligent" the only thing it succeeds in doing is being "too smart for its own good" (there will always be exceptions and odds are the first/normal real world use of it will be just such an exception, but the algorithm thinks it knows best and does the wrong thing). Thus using the simplest measure (like last reference or cpu usage is a good measure [assuming it is not using the cpu due to I/O waiting]) is likely the best and that's what FreeBSD does. Note except for the case of bugs (like the one being discussed in the other subthread) it is very unlikely that you will ever encounter OOM on a real machine these days and if you have an app that might cause an OOM due to its nature then that program almost always has its own swap like feature that it manages on its own. Good example is vi and large files, vi does not keep the whole file in memory, but only window on the current cursor position. -- Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGBxaXmbF-me=MZs13ywcAkXkTUaP-Hx3P5s%2BApTfojdJxiBSg>