6 ms·
I use: (setq gc-cons-threshold most-positive-fixnum) I have 256GB RAM locally so I might as well use it.
by AeroNotix 3y ago
I use:
(setq gc-cons-threshold most-positive-fixnum)
I have 256GB RAM locally so I might as well use it.
- argiopetech 3y agoWow, can you share some more specs?
- AeroNotix 3y agoIt's just a pretty old HP Z820 workstation. Not top of the line by any stretch of the imagination. Here's an older geekbench report: https://browser.geekbench.com/v5/cpu/3159963 https://browser.geekbench.com/v5/cpu/3159963
- dilap 3y agoi use the same trick (who w/ only 16GB of ram) -- so far so good.
- sph 3y agoHaving a lot of RAM doesn't mean you have no need for garbage collection. By definition, garbage collected programs continuously leak memory, and consume all the available resources on the machine. Even setting it to 256GB is a much better idea than just turning off GC. I recommend to maybe halve that to leave just enough RAM for Chrome.
- deleted 3y ago[deleted]
- dilap 3y agoi don't know, my experience in practice is that turning off emacs GC has resulting in no noticeable degradation and has eliminated GC pauses. so why not do it? maybe emacs just doesn't use enough memory, relative to modern systems, for GC to be worth it. (i do quit emacs at the end of each day, so that is a form of GC.)
- sph 3y agoThe memory consumption of GC languages with GC turned will never decrease, and basically keep increasing unless completely idle. Efficiency has nothing to do with it. conses are generated whether you want it or not, for every single line of Lisp executed.
- dilap 3y agosure, but if you're not generating enough garbage over the lifetime of the app for it to matter, why waste time collecting? especially is your collector is an old-school design that hangs the app for a user-noticeable amount of time...
- AeroNotix 3y agoNot everything in emacs is written in elisp. I can tell you _for sure_ that turning off GC in emacs doesn't result in a runaway train of resident memory. You can be incorrect, or you can try it.
- deleted 3y ago[deleted]
- adgjlsfhk1 3y agothis isn't true of all gc languages some (C# and Julia for example) are pretty good at preventing lots of allocations through optimizations.
- AeroNotix 3y agoRight, but if I have so much RAM available, it practically doesn't matter. I've been running emacs since I logged in at 9am, edited ~100 different files. Many LSP inferior-processes running and emacs is currently sitting at 1 whole gigabyte resident memory. What's more is that I would say this is a particularly light day for me and emacs. I have literally never, never, not once ever had an issue with this much RAM and essentially turning gc off in emacs.
- worthless-trash 3y ago> I've been running emacs since I logged in at 9am Yes, but which year ?
- AeroNotix 3y agoThis one.
- gwern 3y agoDo you ever run out of RAM?
- AeroNotix 3y agoNever. I rarely get above 170GB RES. Most days below 30GB, even.
- throwaway81523 3y agoIt is or was a traditional mark-sweep gc, so a very large collection can be slow even if there is not much live data. The gc still has to touch all the garbage to return it to the free lists. Also, Emacs itself might slow down from the terrible cache locality.
- aidenn0 3y ago> I have 256GB RAM locally so I might as well use it. But how much swap space do you have?