Skip to content

Instantly share code, notes, and snippets.

View anticomputer's full-sized avatar

Bas Alberts anticomputer

View GitHub Profile
@anticomputer
anticomputer / my-garbage-collector-init.el
Created April 2, 2020 04:07
little emacs gc "hack" that's served me well
(defvar my/enable-forgiving-gc t "Toggle forgiving gc logic.")
;; set a very large gc-cons-threshold (1GB) so we don't garbage
;; collect when I'm interacting with emacs ... BUT we also want
;; to prevent filling up to a large garbage pile when idle for
;; a long period of time (e.g. overnight), so we reschedule for
;; an interval seconds of idle time ... this way we should prevent
;; both gc when typing but also prevent gc-cons-threshold from
;; actually being reached and potentially triggering a very long gc
;; note: this handy if you want to run fancy modelines and other
;; things that aren't necessarily super memory efficient but either