Questions tagged [garbage-collect]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers

Reducing Emacs Startup Time

I read that changing the default garbage collector settings is not recommended however I noticed it can make an impact on the ...
Zoli's user avatar
  • 421
2 votes
0 answers

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 ...
ideasman42's user avatar
  • 8,546
0 votes
1 answer

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-...
ideasman42's user avatar
  • 8,546
5 votes
1 answer

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))) (...
Tobias's user avatar
  • 32.8k
2 votes
0 answers

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 ...
phs's user avatar
  • 1,095
1 vote
1 answer

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 ...
user avatar
21 votes
2 answers

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 ...
Nova's user avatar
  • 1,059
3 votes
1 answer

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 ...
Alexander Shukaev's user avatar