Improve garbage collection behavior
This commit is contained in:
parent
33a62f66f8
commit
f519f1bb5d
10
init.el
10
init.el
@ -206,11 +206,11 @@
|
|||||||
;; Increase the garbage collection threshold to 100MB for a faster startup time.
|
;; Increase the garbage collection threshold to 100MB for a faster startup time.
|
||||||
(setq-default gc-cons-threshold 100000000)
|
(setq-default gc-cons-threshold 100000000)
|
||||||
|
|
||||||
;; Restore it to 20MB after 5 seconds.
|
;; Restore it to 8MB after initialization is finished.
|
||||||
(run-with-idle-timer
|
(add-hook 'after-init-hook (lambda () (setq gc-cons-threshold 8000000)))
|
||||||
5 nil
|
|
||||||
(lambda ()
|
;; Collect all garbage whenever Emacs loses focus.
|
||||||
(setq gc-cons-threshold 20000000)))
|
(add-hook 'focus-out-hook #'garbage-collect)
|
||||||
|
|
||||||
|
|
||||||
;;========================================
|
;;========================================
|
||||||
|
Loading…
Reference in New Issue
Block a user