From owner-freebsd-questions@freebsd.org Sun Jul 26 09:47:10 2020 Return-Path: Delivered-To: freebsd-questions@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 93A843A28C4 for ; Sun, 26 Jul 2020 09:47:10 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BDylK2YPjz4LQb for ; Sun, 26 Jul 2020 09:47:08 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: by mail-io1-xd41.google.com with SMTP id t15so5090690iob.3 for ; Sun, 26 Jul 2020 02:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JkZXQzewNHyAGMn7NJiQKu6jfZQTcnBksb20zTc0nSs=; b=Old22kW5pQ+B+s7S97M2M2JL+ubBT5xw8LzwbTx8qWSBFUu6l2pHmQ4JW1FMVM0zt/ SYsp/zG9JkhiAR9NJLnw5E8FDXpYNadHc6984cN9Tg/5vELm5whXmLQGgiR1PVnZ4hpN sDaaXtPDZH5Pv9Ply0W7mcPUlnkYxi7tetDU8OTkP/fYsCD5PWLj6xqtCgS8n97HiUs3 Bov/oXHsVKQo422+3cVaG2TCxe2T6u+d6ZuAtqBUb+DJsRNNvoqr6xaPX4fTu8yW1m1Y WL1NnqF4YhsU8OO4W/Wa/lAVq11DKrmoj9qlp0G5ojdSQxFRvgZrAjgahTnWrqTqLxTF Ikzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JkZXQzewNHyAGMn7NJiQKu6jfZQTcnBksb20zTc0nSs=; b=B3b3pyHoKKssXSmGRwqEG0JmR63ta+WnYylmICHnr84vpN32K66Ih60tOlFBzZun5e C2z4boOQFYkD4CKJpXqLsMNV0Y5EXziQEf+0FTCS5ZuJKKvubGsbFZ0FPDlrTiwRqVzr Q/i2K9auJROtSumWbmNQF8XExUEZImyGuiGH2eODbVnl37RBZ4BWguaToRV5AFjTvun8 hwaR7CwBor9C2HoWUVzTDxYiNrc6Eu//HHIUHSywD612a0N+i+7B8nCRpexR1zIZUjKy 4Iyunx8yMGNpyEeJn2D+CFC4qHYG9QMzF/EYusvYwybTIWGwk8lf+klb2cfJjlC741aC /LfA== X-Gm-Message-State: AOAM530Kr+y3OQV9c+Jq76Y/FGfNn9509dvH4NtA336ILF19P72ADDUj 9a7YRBgAFSMuxv0B4VnieeZOzJXzXmbuCKTh3JrG9Txj1Qw= X-Google-Smtp-Source: ABdhPJyzvbtSWXO7Vk0HldRdO6q1pKTsCJXql3MFCzjSDfR5+ZpJULIacN4Kye7Pnlt46OlNG1N7JT+Z//UAqylglUE= X-Received: by 2002:a6b:b4c8:: with SMTP id d191mr12210718iof.174.1595756827483; Sun, 26 Jul 2020 02:47:07 -0700 (PDT) MIME-Version: 1.0 References: <20200214204838.360c8f624397c659946bd764@sohara.org> <20200215063818.GE1482@admin.sibptus.ru> <20200215083359.367d8a3e9ddb4942df67d5b5@sohara.org> <58202623-bbf7-eda0-5cb5-fb4749e91e20@watters.ws> <6318251A-973A-4DEC-9271-12333EB11F7B@kicp.uchicago.edu> <20200725152412.GJ92589@admin.sibptus.ru> <20200725162403.GA4721@admin.sibptus.ru> <20200725182554.deffc63058a7c9f6d343ef06@sohara.org> <04df312d-9b2b-1873-2117-79a49e089bd9@kicp.uchicago.edu> <20200726074655.b0036a0f90508156205376f9@sohara.org> In-Reply-To: <20200726074655.b0036a0f90508156205376f9@sohara.org> From: Aryeh Friedman Date: Sun, 26 Jul 2020 05:46:55 -0400 Message-ID: Subject: Re: Ask stupid questions and you'll get a stupid answers, was: Technological advantages over Linux To: "Steve O'Hara-Smith" Cc: Valeri Galtsev , FreeBSD Mailing List X-Rspamd-Queue-Id: 4BDylK2YPjz4LQb X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Old22kW5; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of aryehfriedman@gmail.com designates 2607:f8b0:4864:20::d41 as permitted sender) smtp.mailfrom=aryehfriedman@gmail.com X-Spamd-Result: default: False [-3.93 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-0.996]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; NEURAL_HAM_LONG(-1.01)[-1.005]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d41:from]; NEURAL_HAM_SHORT(-0.93)[-0.926]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 09:47:10 -0000 On Sun, Jul 26, 2020 at 2:47 AM Steve O'Hara-Smith wrote: > On Sat, 25 Jul 2020 22:46:23 -0400 > Aryeh Friedman wrote: > > > The only thing I can think of is there is a HTML 5 game that I > > often leave open all the time > > That is probably causing Firefox to eat huge amounts of memory > starving everything else and making the system prone to swapping. Try > closing that window, restarting Firefox and then seeing how well your > machine works. > I have already done this experiment and can tell you while it is *PARTIALLY* firefox it is also a fundamental problem with X (and not just the desktop). Experimental lab report: Hypothesis: One or more applications has a resource leak that causes X windows, the app(s) (and all other apps running on the system) to have drastic performance decreases (as measured by response time on non-CPU intensive I/O events) Experiment: Step 1) Reboot machine and start X Step 2) Measure performance Step 3) Start one or more of the offending apps let it run long enough to cause a noticeable performance impact Step 4) Measure performance Step 5) Terminate the offending app(s) via their normal/recommended shutdown method. Step 6) Measure performance Step 7) Repeat steps 3 thru 7 until noticeable loss of performance is noted in step 6 Expected results if there is no system wide performance loss due to the offending apps running: Step 7 should be repeated an undecidable (see CS definition of "undecidable") number of times. If step 7 can only be done 0 time and/or a very small number times (less than 3 times) then we consider this "proof" that the problem is at least partially external to the offending apps. Actual results: While there is a measurable gain in performance in step 6 it does not return to its performance level measured in step 2. Step 7 can only be repeated once before performance becomes unacceptable. Alternative possible explanation: Offending apps and X are not the most current versions from the ports collection. Counter proof to alternative explanation: I update my ports collection at least every 24 hours with the following sequence of commands: cd /usr/ports svn update (read UPDATING if modified) portmaster -ad With the most recent results being: Updated to revision 543457. root@neomarx:/usr/ports # portmaster -ad ===>>> Gathering distinfo list for installed ports ===>>> Starting check of installed ports for available updates ===>>> All ports are up to date and problem has slowly been getting worse Conclusion: While the offending apps (firefox, libreoffice and any multimedia player) do decrease performance stopping and restarting them does not completely solve the problem nor does the problem completely disappear when said apps are not running. This experiment succeeds for all non-X apps and thus we are forced to conclude that at least some of the problem is in X itself in that it never completely deallocates the resources allocated to a given program even after the program terminates. Since the offending apps and GUI config are known to work on Linux without serious performance decay we can only conclude that there is something that causes bad interaction between X and FreeBSD. Repeated attempts at the above experiment over time so the number of times step 7 can be performed are drastically decreasing from essentially undecidable 2 years ago to less then 2 currently and the main difference during this time is the push to make FreeBSD more friendly for X and wayland. > > So the only possible conclusion I can draw > > is it is X being extremely screwy on FreeBSD due to all the linux hacks > in > > it (this despite X's claim it will work on any POSIX machine with the > > right video support). As we move more and more towards wayland as being > > the pixel driver it gets worse. > > However that conclusion isn't supported by the experience of > others, it seems far more likely you have a memory hog, find it and > eliminate it (top is your friend, sorting my resident memory use) and > system performance will improve no end, and yes it may be your desktop > environment, but I'd bet on Firefox which leaks like a seive). > See above. Top clearly shows that X itself is using increasing resources throughout the entire experiment (not just the apps). -- Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org