Subject: Re: bug#15946: 24.3; Mac OS X, Mavericks, distnoted process

From: canoeberry <[email-masked]>
Date: Tue, 14 Jan 2014 12:33:36 -0800 (PST)

I've fired up Emacs with the -q and -nsl options. So my .emacs is not loaded and neither is the site-lisp. It starts leaking memory at a rate ... well here you go:

$ while true
> do
> sudo leaks 12095 | head -20 | grep "leaks for"
> sleep 1
> done
Process 12095: 935 leaks for 165824 total leaked bytes.
Process 12095: 954 leaks for 168864 total leaked bytes.
Process 12095: 972 leaks for 171744 total leaked bytes.
Process 12095: 986 leaks for 173984 total leaked bytes.
Process 12095: 1005 leaks for 177024 total leaked bytes.
Process 12095: 1025 leaks for 180224 total leaked bytes.
Process 12095: 1039 leaks for 182464 total leaked bytes.
Process 12095: 1057 leaks for 185344 total leaked bytes.
Process 12095: 1076 leaks for 188384 total leaked bytes.
Process 12095: 1090 leaks for 190624 total leaked bytes.
Process 12095: 1107 leaks for 193344 total leaked bytes.
Process 12095: 1127 leaks for 196544 total leaked bytes.
Process 12095: 1147 leaks for 199744 total leaked bytes.
Process 12095: 1158 leaks for 201504 total leaked bytes.
Process 12095: 1178 leaks for 204704 total leaked bytes.
Process 12095: 1195 leaks for 207424 total leaked bytes.
Process 12095: 1209 leaks for 209664 total leaked bytes.

So it's basically something like 20 individual 160 byte leaks per second. If I actually use emacs it seems to have spurts of many more leaks. These do seem like proper leaks because my emacs memory is growing at the same rate as this leaks is reporting, and, I am literally running an emacs with nothing in it and not interacting with it.

Output from dtruss shows kevent activity. A bunch of it. Not much else:

workq_kernreturn(0x20, 0x0, 0x1)		 = 0 0
kevent64(0x3, 0x0, 0x0)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x0, 0x0)		 = 1 0
kevent64(0x3, 0x1006CB4F8, 0x1)		 = 1 0
kevent64(0x3, 0x0, 0x0)		 = 1 0
kevent64(0x3, 0x0, 0x0)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x0, 0x0)		 = 1 0
kevent64(0x3, 0x1006CB3E8, 0x1)		 = 1 0
kevent64(0x3, 0x1006CB4F8, 0x1)		 = 1 0
kevent64(0x3, 0x0, 0x0)		 = 1 0
kevent64(0x3, 0x0, 0x0)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x7FFF5FBFD2E8, 0x1)		 = 1 0
kevent64(0x3, 0x0, 0x0)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x7FFF5FBFE8B8, 0x1)		 = 1 0
workq_kernreturn(0x20, 0x0, 0x1)		 = 0 0
kevent64(0x3, 0x7FFF5FBFCAF8, 0x1)		 = 1 0
kevent64(0x3, 0x0, 0x0)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x0, 0x0)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
kevent64(0x3, 0x1006CB458, 0x1)		 = 1 0
setitimer(0x0, 0x7FFF5FBFD0B0, 0x0)		 = 0 0
kevent64(0x3, 0x7FFF5FBFE8C8, 0x1)		 = 1 0
workq_kernreturn(0x20, 0x0, 0x1)		 = 0 0
workq_kernreturn(0x20, 0x0, 0x1)		 = 0 0

This is grasping at straws at its worst.

JP

On 14 Jan 2014, at 17:47, Jan Djärv [via Emacs] <[email-masked]> wrote:

> Hello. 
> 
> 14 jan 2014 kl. 18:15 skrev canoeberry <[hidden email]>: 
> 
> > I have been observing this since Mavericks was released. I did not make a 
> > connection between distnoted and emacs, other than the following 
> > observation: both are leaking memory. 
> > 
> > For the first time ever I am finding that my emacs process slowly grows in 
> > size. I can be editing a small handful of files and be using 500Mb of real 
> > memory. Never seen that before, ever. 
> > 
> > Distnoted grows much faster, on the order of 1Gb real memory / day. Killing 
> > that process and having another start up automatically causes some OS X 
> > features to stop working, e.g., it is not possible to enter Time Machine or 
> > even see the status of your Time Machine backups anymore. 
> > 
> > I have seen distnoted peg the CPU when Time Machine backups are running or 
> > recently completed. Meanwhile, the menubar no longer animates the 
> > in-progress backup, which I assume is not on purpose and possibly even 
> > related to the issue. 
> >
> 
> I think that is so OSX can save a bit of power. 
> 
> > I do not use shells in emacs nowadays. 
> > 
> > I am running emacs from emacsformacosx. 
> > 
> > I have filed bugs with Apple. 
> > 
> > If anybody has any suggestions on how to figure out what is causing Emacs to 
> > grow in size, I will happily run some experiments for you. I tried to figure 
> > out how to profile emacs memory but it was not very obvious to me what to 
> > do.
> 
> The obvious thing is to run leaks on Emacs (man leaks) after a garbage collection has been made (M-x garbage-collect).  Leaks may report leaks which in fact are not due to uncollected garbage. 
> 
>         Jan D. 
> 
> 
> 
> 
> 
> 
> If you reply to this email, your message will be added to the discussion below:
> http://emacs.1067599.n5.nabble.com/bug-15946-24-3-Mac-OS-X-Mavericks-distnoted-process-tp303500p310141.html
> To unsubscribe from bug#15946: 24.3; Mac OS X, Mavericks, distnoted process, click here.
> NAML

-----
Jonathan Payne

--
View this message in context: http://emacs.1067599.n5.nabble.com/bug-15946-24-3-Mac-OS-X-Mavericks-distnoted-process-tp303500p310185.html
Sent from the Emacs - Bugs mailing list archive at Nabble.com.