Is this in Big Sur or Monterey? I know Monterey had problems with "memory leaks" in certain applications.I’ve just had it again: all of a sudden my Mac starts behaving strangely. Remote Desktop would hang, the Dock wouldn’t show up on occasions, Mail had allocated 14 GB RAM, with total app RAM usage at 29 GB ( I have a 32 GB RAM Mac). I’m not rendering movies or things like that. Running Eclipse, Mail, browsers, some more smaller apps. Before that, my Mac seemed to work for about a week, being used every day for around 8-10 hours.
I rebooted, and everything was back to normal.