[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15946: a patch against emacs 24.3.1 for fixing the distnoted memory

From: Jonathan Payne
Subject: bug#15946: a patch against emacs 24.3.1 for fixing the distnoted memory leak
Date: Mon, 20 Jan 2014 10:43:57 +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 

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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]