GNU bug report logs - #15946
24.3; Mac OS X, Mavericks, distnoted process

Previous Next

Package: emacs;

Reported by: Donald Tillman <don <at> till.com>

Date: Thu, 21 Nov 2013 18:19:01 UTC

Severity: normal

Tags: moreinfo

Found in version 24.3

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


Message #95 received at 15946 <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Payne <emacs <at> jpayne.net>
To: 15946 <at> debbugs.gnu.org
Subject: a patch against emacs 24.3.1 for fixing the distnoted memory leak
Date: Mon, 20 Jan 2014 12:01:30 +0000
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





This bug report was last modified 8 years and 311 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.