From: SB <richstyles@gmail.com>
To: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: "15946@debbugs.gnu.org" <15946@debbugs.gnu.org>
Subject: bug#15946: 24.3; Mac OS X, Mavericks, distnoted process
Date: Fri, 27 Dec 2013 14:15:37 +0900 [thread overview]
Message-ID: <CAHyndBEj366JpFT_bUHzSuvJaPSvRHO1esghqgxBpmLF_ywVXg@mail.gmail.com> (raw)
In-Reply-To: <F5207BA6-4880-40C3-BD71-B0207563C287@swipnet.se>
Hello, I've investigated this problem since I had similar symptoms
that correlated with everyone else's reports (quit emacs.app and
distnoted quiets down). Also, in my case when I download the vanilla
emacs.app from the emacs for OSX site, the problem does not appear. In
my case, under Mavericks, this problem only occurs when I use
Emacs.app with the inline patch applied (for more native Japanese
input).
Emacs inline patch
http://svn.sourceforge.jp/svnroot/macemacsjp/inline_patch/trunk/emacs-inline.patch
After investigating, it seems that the purpose of distnoted is to
serve as a daemon to facilitate interapplication communication. In the
case of the "inline patch", to capture the moment the IME is changed
so that Emacs can do likewise to change language input. This is done
by adding an observer using NSDistributedNotificationCenter and there
is also a corresponding Core Foundation method. I didn't find any used
of NSDistributedNotificationCenter in the official release (24.3)
source.
https://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/classes/NSDistributedNotificationCenter_Class/Reference/Reference.html
The fix was to add
"suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately"
rather than the default which was
"NSNotificationSuspensionBehaviorCoalesce". For whatever reason,
modifying the inline patch in this manner fixed the issue for me. This
would be consistent with the report above that "Cmd Tabbing" seems to
trigger it (since it would activate the suspension behavior).
Others with the same problem seem to take a sledgehammer approach of
killing distnoted with a cronjob (which I did manually as well).
This is the patch (modified by hand so it may not apply) against emacs 24.3.
https://gist.github.com/anonymous/8142555
The modified line:
[[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp
selector: @selector (changeInputMethod:)
name:
@"AppleSelectedInputSourcesChangedNotification" object: nil
suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately];
Suspension Behavior
https://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/classes/NSDistributedNotificationCenter_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSNotificationSuspensionBehavior
For others who do not use the patch, there may be other applications,
since this is most likely a bug with Mavericks itself and you may want
to log distnoted for additional hints and grep the source of your
emacs build to see if NSDistributedNotificationCenter is being used.
Logging Distnoted
http://www.cocoawithlove.com/2009/02/interprocess-communication-snooping.html
Hope this helps someone.
Cheers,
Sam
On Mon, Dec 9, 2013 at 7:06 PM, Jan Djärv <jan.h.d@swipnet.se> wrote:
> Hello.
>
>> 9 dec 2013 kl. 05:38 skrev Christopher Smith <cbsmith@gmail.com>:
>>
>> Donald Tillman <don <at> till.com> writes:
>>> Hi!
>>>
>>> I use Emacs on Mac OS X, Mavericks, Intel MacBook Pro, downloaded from
>>> emacsformacosx.com.
>>>
>>> Running Emacs, a process named "distnoted" starts around 1% or 2% of the
>>> CPU, and after a while, slowly works its way up to 50% to 100% of
>>> the CPU. Yoiks! Actually there appear to be 3 distnoted processes,
>>> but only one eats up the CPU.
>>>
>>> Quitting Emacs brings distnoted down to under 1% within seconds.
>>
>> Just wanted to bump this up, as I've now seen this bug myself. Not sure
>> why Emacs is causing the problem. My emacs was built from macports.
>
> It is no use bumping anything that isn't reproducable. More helpful would be if those that have this can do some debugging. For example dtruss on Emacs and distnoted.
>
> Jan D.
>
>
next prev parent reply other threads:[~2013-12-27 5:15 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-21 18:18 bug#15946: 24.3; Mac OS X, Mavericks, distnoted process Donald Tillman
2013-11-25 22:27 ` Marc Feeley
2013-11-26 7:50 ` Jan Djärv
2013-11-27 21:10 ` Piet Jaspers
[not found] ` <mailman.7276.1385588062.10748.bug-gnu-emacs@gnu.org>
2013-11-28 5:47 ` louisnoel.pouchet
2013-12-09 4:38 ` Christopher Smith
2013-12-09 8:18 ` YAMAMOTO Mitsuharu
2013-12-09 10:06 ` Jan Djärv
2013-12-27 5:15 ` SB [this message]
2014-01-07 22:56 ` Jan Djärv
2014-01-08 3:35 ` Josh
2014-01-08 9:24 ` Jan Djärv
2014-01-14 17:15 ` canoeberry
2014-01-14 17:46 ` Jan Djärv
2014-01-14 20:09 ` canoeberry
2014-01-14 22:10 ` Jan Djärv
2014-01-14 22:59 ` Matthew Leach
2014-01-15 7:52 ` Jan D.
2014-01-15 10:53 ` Matthew Leach
2014-01-14 20:33 ` canoeberry
2014-01-14 21:34 ` Stefan Monnier
2014-01-14 21:53 ` canoeberry
2014-01-14 22:07 ` Jan Djärv
[not found] ` <ABF72EE5-E9C7-4950-8E9F-D2632A5DCF91@jpayne.net>
2014-01-15 6:26 ` Jan Djärv
2014-01-15 13:41 ` Jonathan Payne
2014-01-17 14:11 ` vbeffara
2014-01-18 22:52 ` canoeberry
2014-01-19 9:33 ` Jan Djärv
2014-01-19 10:49 ` canoeberry
2014-01-20 9:53 ` SB
2014-01-20 11:15 ` Jan Djärv
2015-12-26 1:14 ` Lars Ingebrigtsen
2016-07-17 20:57 ` Alan Third
2014-01-20 10:43 ` bug#15946: a patch against emacs 24.3.1 for fixing the distnoted memory leak Jonathan Payne
2014-01-20 12:01 ` Jonathan Payne
2014-01-20 12:32 ` SB
[not found] ` <mailman.7121.1385419042.10748.bug-gnu-emacs@gnu.org>
2014-05-02 11:33 ` bug#15946: 24.3; Mac OS X, Mavericks, distnoted process tony
[not found] ` <handler.15946.D15946.14687890696153.notifdone@debbugs.gnu.org>
2016-07-18 2:00 ` bug#15946: closed (Re: bug#15946: 24.3; Mac OS X, Mavericks, distnoted process) Donald Tillman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHyndBEj366JpFT_bUHzSuvJaPSvRHO1esghqgxBpmLF_ywVXg@mail.gmail.com \
--to=richstyles@gmail.com \
--cc=15946@debbugs.gnu.org \
--cc=jan.h.d@swipnet.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).