From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jonathan Payne Newsgroups: gmane.emacs.bugs Subject: bug#15946: a patch against emacs 24.3.1 for fixing the distnoted memory leak Date: Mon, 20 Jan 2014 12:01:30 +0000 Message-ID: <7F6FC6C7-9847-4560-98CB-A09C107D1F56@jpayne.net> References: <013FF6AE-1615-454A-AB1E-A289EC1E67F0@till.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1390219330 23617 80.91.229.3 (20 Jan 2014 12:02:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Jan 2014 12:02:10 +0000 (UTC) To: 15946@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 20 13:02:17 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W5DYX-0004MR-1Q for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Jan 2014 13:02:17 +0100 Original-Received: from localhost ([::1]:51253 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5DYW-0001gU-NA for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Jan 2014 07:02:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5DYO-0001gP-Fs for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 07:02:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5DYI-0007FW-G4 for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 07:02:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5DYI-0007FR-7t for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 07:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W5DYH-0006Mk-Qg for bug-gnu-emacs@gnu.org; Mon, 20 Jan 2014 07:02:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <013FF6AE-1615-454A-AB1E-A289EC1E67F0@till.com> Resent-From: Jonathan Payne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Jan 2014 12:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15946 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 15946-submit@debbugs.gnu.org id=B15946.139021929824437 (code B ref 15946); Mon, 20 Jan 2014 12:02:01 +0000 Original-Received: (at 15946) by debbugs.gnu.org; 20 Jan 2014 12:01:38 +0000 Original-Received: from localhost ([127.0.0.1]:57885 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W5DXt-0006M4-Dm for submit@debbugs.gnu.org; Mon, 20 Jan 2014 07:01:38 -0500 Original-Received: from caibbdcaacbf.dreamhost.com ([208.113.200.215]:57035 helo=homiemail-a78.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W5DXq-0006Lw-OC for 15946@debbugs.gnu.org; Mon, 20 Jan 2014 07:01:35 -0500 Original-Received: from homiemail-a78.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a78.g.dreamhost.com (Postfix) with ESMTP id 2DF7620004749 for <15946@debbugs.gnu.org>; Mon, 20 Jan 2014 04:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jpayne.net; h=from :content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; s=jpayne.net; bh=EClYZwapOcC6ovAd2dMZ4Htlp40=; b= b5Zm3bFboT/xEpRxq439XOGXJCucUYpLQhr790OOL13AP/6aTN+r2ZtIVSp7CsiE Zw3dbA3T2gBAuiKqr8j94SYzu4T4iJt3B1lAUKr40NI1PGCVXt/Jsiygpyn7lo3U 0m3OeFqT86KjGmMkxQFpvtj7lSHthLcUjkNkaBYvfCU= Original-Received: from [10.0.1.92] (cpc7-camd15-2-0-cust712.20-2.cable.virginm.net [94.174.158.201]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jonathan@payne-family.org) by homiemail-a78.g.dreamhost.com (Postfix) with ESMTPSA id 9B35B20004746 for <15946@debbugs.gnu.org>; Mon, 20 Jan 2014 04:01:32 -0800 (PST) X-Mailer: Apple Mail (2.1827) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:83764 Archived-At: This is FYI for people who do not want to wait for emacs 24.4 and cannot = use one of the current nightlies to get around the Mavericks distnoted = issue. I am not a Mac programmer unfortunately, so take this with a grain of = salt. My analysis of the problem is this: 1) When Mavericks came out a memory leak was discovered and fixed by Jan = D. who is a frequent contributor to ns (Next Step) emacs for Mac OS X. 2) His fix, I think, was to avoid calling Application.run 20 times / = second by introducing a variable called "shouldKeepRunning" into the = Application.run method. 3) Repeatedly calling Application.run was causing a 160 byte leak each = time inside emacs. But I think it was also causing a problem with = distnoted, and I am speculating (knowing NOTHING ABOUT IT) that each = call to run() was causing some sort of registration with distnoted. That = registration, I assume, creates some sort of context in distnoted that = is substantially larger than 160 bytes. So the leak in emacs was = relatively slow, the one in distnoted was much larger. This would also explain why distnoted would get slower as time goes by = because it has hundreds of thousands of registrations, all for emacs, = which I assume it was still trying to deliver notifications to, but = really, I have no idea what I am talking about. So, I applied part of Jan D's patch to emacs-24.3 that addressed this = particular problem, and presto-chango, the leak is gone, distnoted is = happy, and all my current elisp packages work because it's still = emacs-24.3 and not emacs-24.4 which I assume is what's being created in = the trunk today. So - should I post this particular patch some place? Are other people = interested in having this patch? JP