What OS?
"Windows 10".
~~~~~~~~~~~~
Thought so.... For some reason, it appears that Microsoft OS & application developers never embraced the rigorous discipline of making sure data like variables, pointers, handles, etc., are always disposed of as soon as they are no longer needed. So, "the 'crap'" you referred to seems to build up -- consuming ever-more memory. Sooner or later a re-boot is needed to "clean house".
Many of us Mac developers learned to program on machimes with esxtremely limited memory. (My first serious app was developed on the Apple ][GS -- and "ported" to the Mac...) So -- we had to earn to "write 'lean and clean'" -- as a "way of life"...
It is terribly boring and tedious, but much of my code is devoted to disposing of unused bits of memory. Nowadays, OSX (and its programming language, "Swift", (which I'm teaching myelf at 78 yrs of age) handle most of that "grunt-work" for the developer.
~~~~~~~~~~
...Just another of those differences between the Apple "culture" and others, I guess...
Your elf is 78 yo and does not know Swift yet?;-)
Only language I ever really did anything with was FORTRAN.