From owner-freebsd-ports@freebsd.org Sat Nov 4 11:49:43 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7D2AE6C3E4 for ; Sat, 4 Nov 2017 11:49:43 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay108.isp.belgacom.be (mailrelay108.isp.belgacom.be [195.238.20.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3959C6B259; Sat, 4 Nov 2017 11:49:42 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AD1aU0x9WaHSDtv9uRHKM819IXTAuvvDOBiVQ1KB3?= =?us-ascii?q?2+McTK2v8tzYMVDF4r011RmSDNWds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2e2//57ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMNboRr4oRzut86ZrSAfpiC?= =?us-ascii?q?gZMT457HrXgdF0gK5CvR6tuwBzz4vSbYqINvRxY7ndcMsUS2RBQMhfSi9PDYGy?= =?us-ascii?q?b4QAE+UPMv1Vr5X/qlcSsReyGRWgCP3pxzRVhnH2x6o60+E5HA/Y3QwgHdYOu2?= =?us-ascii?q?nKodXyM6cSSv66zKzSwjXFdPNdxDDw6JTJchAjpfGBRrJ+cdDPxkYxCg7Lk1ue?= =?us-ascii?q?pZbiPzOP2eQAqm6W5PduW+Kojm4osQBxoj63y8cikInGmJwaxUvf9Spk2oo1Is?= =?us-ascii?q?e4SEFjbd6hF5tRtiCaN49yQsw4WW1ovzw6yrIAtJWmfyYK0Iwqyh3CZ/CdbYSF?= =?us-ascii?q?7RLuWPyMLTp7i39pYrKyiwi0/EO90OPzTNO030xPriddl9nMsW0C2ALL58icT/?= =?us-ascii?q?t94l+h2TGS1wDP8u1EIV47la7cK5M5wb4/jJ4TsUXGHiDogkX2i7Wadlkl+uiq?= =?us-ascii?q?7+TreKnpppibN49vlA7+N74hmsqkAegiNQgORWeb9fy91L3l40L5XK1Hg/4rnq?= =?us-ascii?q?XDrpzXKsQWqrSkDwJW3Ysv8RayAym+3NQdh3YHLVZFeBydj4juPlHDOOz4Dfa9?= =?us-ascii?q?g1SoizpryerGMaP/DZrWNXjMja3tfbFn605T0AYz18xQ54pICrEdJ/L+QkHxtM?= =?us-ascii?q?bGARAnKAO02PvoBMxl1oMZQ2KPHrSZPbjcsV+S+O0gPfKDZJQItzrnLPgl/fHu?= =?us-ascii?q?h2cjmVABZampwYcXaHegE/RkOEqWf3vsjcsBEWoRsAo+VvLlh0OZXj5Ienm+Ra?= =?us-ascii?q?U85is0CNHuMYCWZImryJaM3Sy7VslUbG1HAVCkP23leq+/d7ELci3EceF7lTlR?= =?us-ascii?q?abmjT8cK0ha1uQrzzaEvevbV+Ckwm4ju2fJOy6vUjx5kpm88NNiUz2zYFzI8pW?= =?us-ascii?q?gPXTJjmfkn+UE=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2D9BwDnp/1Z/zS49VFcGwEBAQMBAQEJA?= =?us-ascii?q?QEBgzRUEG4UE48QjiUBAYF7MwGYIy+FFgKEVkQUAQEBAQEBAQEBAWooQg4BgWc?= =?us-ascii?q?kAYJCAQUnExwjEAsOCgklDyoeBhOKJwyqGjqLEAEBAQEBAQEBAgEBAQEBAR0Fg?= =?us-ascii?q?y6IbYM+h0oFog6HZo0JgQCSQYxhim42IYFsVTIIgy2EYEA2AYMgiTsBAQE?= X-IPAS-Result: =?us-ascii?q?A2D9BwDnp/1Z/zS49VFcGwEBAQMBAQEJAQEBgzRUEG4UE48?= =?us-ascii?q?QjiUBAYF7MwGYIy+FFgKEVkQUAQEBAQEBAQEBAWooQg4BgWckAYJCAQUnExwjE?= =?us-ascii?q?AsOCgklDyoeBhOKJwyqGjqLEAEBAQEBAQEBAgEBAQEBAR0Fgy6IbYM+h0oFog6?= =?us-ascii?q?HZo0JgQCSQYxhim42IYFsVTIIgy2EYEA2AYMgiTsBAQE?= Received: from 52.184-245-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.245.184.52]) by relay.skynet.be with ESMTP; 04 Nov 2017 12:49:33 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id vA4BnXPd001914; Sat, 4 Nov 2017 12:49:33 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Sat, 4 Nov 2017 12:49:32 +0100 From: Tijl Coosemans To: Jan Beich Cc: freebsd-ports@FreeBSD.org Subject: Re: FireFox memory usage Message-ID: <20171104124932.08551078@kalimero.tijl.coosemans.org> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Nov 2017 11:49:44 -0000 On Wed, 01 Nov 2017 21:10:13 +0100 Jan Beich wrote: > Jan Beich writes: >> Andrea Venturoli writes: >>> I'm on 10.3/amd64 with firefox-esr 52.3.0. >>> >>> Since a few days my 4GiB desktop is crawling due to swap usage and >>> looking at top, I see FireFox using almost 7GiB of RAM (SIZE column), >>> 2.5 of which are "RES". >> >> Check about:memory and Devolper Tools -> Memory for clues. For more >> advanced debugging (DMD, Refcount tracing) you'd need a custom build. >> >> Firefox on FreeBSD is known to consume more memory than on other >> platforms because it uses system jemalloc rather than mozjemalloc. >> Mozilla doesn't test memory usage without mozjemalloc. However, porting >> mozjemalloc has stalled[1] unless someone helps. >> >> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1153683 > > If one is on Firefox 55+ or FreeBSD 12+ while suboptimal compared to > mozjemalloc the old jemalloc4 optimizations can be restored by > > $ MALLOC_CONF="narenas:1,tcache:false" firefox ... > > https://dxr.mozilla.org/mozilla-esr52/source/memory/build/jemalloc_config.cpp#35 This appears to be such a huge improvement that you should really put this in the port even if it's still not as good as mozjemalloc. You may also want to add the firefox patch attached to bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222356. It reduces disk I/O, which is a big performance improvement on older systems with slow disks. The kernel patches in that bug remove over 90% of the I/O but not all, and FreeBSD releases don't have those patches yet.