# Tutorial :Emacs 23.1.50.1 hangs ramdomly for 6-8 seconds on Windows XP

### Question:

I have EmacsW32 23.1.50.1 emacs working on my windows XP machine. It hangs randomly for 5 to 8 seconds and quite frustrating.

Any one has solution?

I even tried using emacs win32 binaries (23.1) from gnu ftp site and that also hangs for few seconds.

Here some notable processmonitor logs

10:57:55.5073038 PM QueryAllInformationFile C:\emacs.emacs.d\auto-save-list BUFFER OVERFLOW CreationTime: 8/27/2009 12:51:26 PM, LastAccessTime: 1/5/2010 10:54:40 PM, LastWriteTime: 1/5/2010 10:08:15 PM, ChangeTime: 1/5/2010 10:08:15 PM, FileAttributes: D, AllocationSize: 0, EndOfFile: 0, NumberOfLinks: 1, DeletePending: False, Directory: True, IndexNumber: 0x1000000001f702, EaSize: 0, Access: Read Attributes, Synchronize, Position: 0, Mode: Synchronous IO Non-Alert, AlignmentRequirement: Word

### Solution:1

I had exactly the same problem using EmacsW32 23.1.50 on WinXP. One change I made that had a significant improvement (for me anyway) was to add the following to my .emacs file:

; try to improve slow performance on windows.  (setq w32-get-true-file-attributes nil)  

It seems this variable was changed to default to "true" relatively recently and is known to cause some slow-down problems around file access. I still get some random hangs now and then (probably due to my .emacs customisations) but it is much better now.

### Solution:2

Please try stopping Netlogon service in "Services" control panel. That solved the problem in my case. See the excellent article http://www.hydrus.org.uk/journal/emacs-netlogon.html that saved me from the agony.

This only applies to a small (yet increasing?) group of users that:

• use corp issue laptop
• use windows 7
• use emacs for R editor
• suddenly see her emacs working very slow

### Solution:3

I was having similar issues and traced it to network timeouts on Windows. In my particular case, it was due to ido.el, which keeps a cached list of directory contents. At startup, ido was trying to check the cached directories, which included network shares on both my home network and my work network â€" there were always some nonexistent hosts, no matter which network I was on.

Because my problem was originating with ido (sort of), the solution for me was to set ido-max-dir-file-cache to 0 (via customize-variable or init.el), then exit Emacs, delete ~/.emacs.d/.ido.last, and restart Emacs. Based on what I saw in another thread, it's important to make sure all instances of Emacs are closed before trying to delete .ido.last. There may be other ido variables that need to be changed, but so far, this solution is working for me.

### Solution:4

Without some debugging output it will be difficult to say what is causing the delay.

Since delays are often caused by IO operation timeouts, I recommend running Process Monitor to see what Emacs is doing while it is hanging.

### Solution:5

I have windows 7, that was happening to me because i was using Classic Windows UI, once i changed to the default theme it worked great, maybe also Themes service has something to do with that, so if you stopped it, try running it.

### Solution:6

After disabling global-auto-revert-mode, the system does far less I/O. For me, this seemed to have solved the problem.

### Solution:7

This is related to the disabling netlogon answer. It turned out that turning off netlogon was giving me issues with networked drives so it was a nuisance to disable it. I discovered that a long time I switched my dns provided to google's public dns. This turns out to be a very bad idea in a corporate domain. I switched it back to auto-detect dns and the problem went away.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »