Questions tagged [garbage-collect]
The garbage-collect tag has no usage guidance.
8 questions
0
votes
2
answers
731
views
Reducing Emacs Startup Time
I read that changing the default garbage collector settings is not recommended https://lists.gnu.org/archive/html/help-gnu-emacs/2007-06/msg00243.html however I noticed it can make an impact on the ...
2
votes
0
answers
75
views
Do markers need to be explicitly cleared to be garbage collected?
When creating markers, should code that may fail (a user defined function for example) clean-up after it's self?
So for example, new markers are created, the function of unknown origin is called, on ...
0
votes
1
answer
99
views
How to define a singe weak reference in elisp?
Hash tables in elisp supports weak references, however weak references may be useful without the need to use a hash.
How can a weak reference to an object be defined without having to use a hash-...
5
votes
1
answer
138
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
0
answers
160
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
1
answer
697
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 ...
23
votes
2
answers
8k
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 ...
3
votes
1
answer
1k
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 ...