Questions tagged [garbage-collect]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
1answer
45 views

Why does a let-bound huge list survive garbage collection after the let form?

Note that the following original test is errorneous and has been superseded by the EDITED version below. (progn (message "Before: %S" (memory-use-counts)) (let ((x (make-list 100000000 0))) (...
2
votes
0answers
87 views

Freeing cons cells after use in emacs-lisp?

Is there a way in emacs-lisp to return cells to the free list once I do not use them any more? This would be useful in code where I build huge lists temporarily and can free them without waiting for ...
1
vote
1answer
407 views

How does emacs mark the stack for GC

Since I tried creating my own Lisp interpreter (just for learning purposes, as I knew it wouldn't get too far), I have read and tried to understand the internal workings of the Elisp interpreter and ...
16
votes
1answer
2k views

Is there any downside to setting `gc-cons-threshold` very high and collecting garbage when idle?

I added the following two lines to the top of my init.el: (setq gc-cons-threshold (eval-when-compile (* 1024 1024 1024))) (run-with-idle-timer 2 t (lambda () (garbage-collect))) That means that ...
2
votes
1answer
662 views

Garbage collection: Memory leak?

Let's roll: $ emacs -Q M-x shell $ while true; do echo XXXXXXXX; done Depending on how much RAM you have in total, wait for some reasonable amount. For instance, I'm typically waiting until the ...