Recently I have downloaded emacs on my system to edit large files as it claims. When trying opening large files, the emacs gives me a problem that buffer size is exceeded.
Is there a way to increase it?! I have a system with memory of 24 GB!
Emacs compiled on a 64-bit machine can handle much larger buffers; up to most-positive-fixnum (2.3 exabytes). Due to things like decoding of multibyte characters, you can only visit files with a size that is roughly half the buffer size limit.
Solution 1: Download a Dedicated Large File Viewer If all you need to do is read the large file, you can download a dedicated large file viewer such as the Large Text File Viewer. Such tools will open large text files with ease.
I've never used it but vlf.el is an elisp hack to view overly large files. I believe it uses insert-file-contents
, but reads from an offset so as to do something akin to pagination.
There are some notes on the wiki but no solutions apart from vlf.el
which I've linked to above.
Type M-:(log most-positive-fixnum 2)
to see whether the return value is closer to 64 or 32. If the latter, compile or get yourself a 64-bit Emacs. Also look at M-x find-file-literally if large files cause sluggishness; it should disable some time consuming operations such as font-lock-mode
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With