;; NOTE: This GCMH minimizes GC interference with the activity by using a high GC
;; threshold during normal use, then when Emacs is idling, GC is triggered and a
;; low threshold is set. We set the threshold (`gc-cons-threshold'
;; variable) to an unlimited size in "early-init.el", this helps improving the
;; startup time, but needs to be set down to a more reasonable value after Emacs
;; gets loaded. The use of `gcmh-mode' ensures reverting this value so we don't
;; need to do it manually. -- I changed this configuration, see my comments around
;; my setup of gcmh
(setq
;; set a high value before initialization, and it should be reduced to a
;; proper value after init
gc-cons-threshold most-positive-fixnum
gc-cons-percentage 0.3
read-process-output-max (* 10 1024 1024))
(defun mk/setup-gc()
(setq
gc-cons-threshold (* 100 1024 1024)
gc-cons-percentage 0.3
read-process-output-max (* 10 1024 1024)
;; Don’t compact font caches during GC.
inhibit-compacting-font-caches t))
(add-hook 'after-init-hook #'mk/setup-gc)