[Text #format, to setup your text editor] You want a "Better garbage collection" in your #Emacs?
Here is a solution: https://config.phundrak.com/emacs/basic-config.html#better-garbage-collection
This was explained during the 2024-05-02 french on-line workshop called "Atelier #Emacs", by the author @phundrak@emacs.ch, thank you! And happy emacsing!