On Fri, Feb 24, 2023 at 10:08:11PM +0200, Petteri Hintsanen wrote: > writes: > > > On Tue, Feb 21, 2023 at 11:21:47PM +0000, Drew Adams wrote: > >> What is it that you're really trying to do? > > > > That's exactly the point, yes. > > Specifics, as usual, are somewhat messy. But I try to summarize below. [...] Thanks for this very interesting dive :) It seems you so deeper in the rabbit hole that my general handwaving doesn't do justice to it. I'd suggest to call `garbage-collect' explicitly from some strategic point in your code will tell you what kinds (and how many) of objects have been collected. You could then at least have a rough idea on where to focus your efforts (are the many buffers killing you -- or rather loads and loads of small cons pairs? Or those many vectors?) There are many knobs and variables to "look into" what the garbage collector is thinking, see "Garbage Collection" and "Memory Usage" in Appendix E of the Elisp manual (the Web version is here [1], if you prefer that). Thanks for hacking :-) Cheers [1] https://www.gnu.org/software/emacs/manual/html_node/elisp/GNU-Emacs-Internals.html - tomás