Emacs Slow or Freezing With Large Files
Workaround available Windows, macOS, Linux Updated November 14, 2026Based on 3 user reportsHow we research
Quick answer
Emacs can hang on huge files or files with very long lines because font-lock and major modes work on the whole buffer. Use so-long, fundamental mode or a large file warning threshold.
Most likely fix: Enable so-long
How to fix it
Try these in order — the most common fix is first.
1. Enable so-long
- Run M-x global-so-long-mode
- Add (global-so-long-mode 1) to your init file
- Emacs switches to a lightweight mode on files with very long lines
Did this fix it?2. Open as plain text
- Run M-x fundamental-mode in the buffer
- Or open the file with M-x find-file-literally
Did this fix it?3. Check your packages
- Disable indent-guides, linters and LSP in the buffer to test
- Use C-g to interrupt a hung command
Did this fix it?4. Use a viewer for huge logs
- Try the vlf package (View Large Files) from MELPA
Did this fix it?
Symptoms
Emacs freezes when opening a big log, JSON or minified file; scrolling lags; typing is delayed in large source files.
Why it happens
- Syntax highlighting and indentation on very long lines
- Extra minor modes such as indent guides, LSP or linters running on large buffers
- Emacs reading the whole file into memory
This guide also covers
- emacs slow large files
- emacs freezes opening big file
- emacs long lines slow
Still not working?
If GNU Emacs keeps failing, you're not alone. See every GNU Emacs problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
All crashes, freezes & blank screens guides →
IntelliJ IDEA Slow or Freezing (JetBrains IntelliJ)
Other GNU Emacs errors
- Emacs Failed to Verify Signature (ELPA Package Install Error)
- Emacs Slow Startup
- Emacs Native Compilation Warnings Popping Up
- Emacs Eglot / LSP Not Working
- Emacs macOS Operation Not Permitted (Documents, Desktop, iCloud)
- Doom Emacs Errors After Update or doom sync
- Emacs package-install Fails (Package Not Found or Archive Error)