Skip to content

Commit

Permalink
fix: don't use unlimited GC threshold, cases too much memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Dec 5, 2024
1 parent 6165cae commit 0309810
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
5 changes: 3 additions & 2 deletions early-init.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
(setq
;; Do not make installed packages available when Emacs starts (we use `straight')
package-enable-at-startup nil
;; Avoid garbage collections during startup, this will be overwritten by `+minemacs--gc-tweaks-h'
gc-cons-threshold most-positive-fixnum
;; Better garbage collection settings, no GCMH required, See: https://zenodo.org/records/10518083
gc-cons-threshold (* 128 1024 1024)
gc-cons-percentage 0.2
;; Prefer loading newer files
load-prefer-newer t
;; Remove some unneeded UI elements
Expand Down
11 changes: 0 additions & 11 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,6 @@
;; by `+env-deny-vars'.
(+env-load) ; Load environment variables when available.

;; HACK: The `gc-cons-threshold' has been set in "early-init.el" to
;; `most-positive-fixnum' to avoid garbage collection during startup. We will
;; overwrite it at the end of `minemacs-lazy-hook' to maximize the benefit.
(defun +minemacs--gc-tweaks-h ()
"Better garbage collection settings, no GCMH required.
See: https://zenodo.org/records/10213384."
(setq gc-cons-threshold (* 128 1024 1024)
gc-cons-percentage 0.25))

(add-hook 'minemacs-lazy-hook #'+minemacs--gc-tweaks-h 90)

(defun +minemacs--loaded-h ()
"This is MinEmacs' synchronization point.
Expand Down

0 comments on commit 0309810

Please sign in to comment.