Auto-translated
A fresh start with a new profile, no dubious or resource-intensive mods, remove all custom maps and campaigns that might affect the map/campaign, and avoid making 100500 saves during gameplay. If that doesn't work, which is highly unlikely, then don't play on those settings.

P.S. I'm glad that, according to modern marketing standards, you're confident that 16 GB is too little (the sellers of 32 GB are probably very happy). I just haven't encountered any games where I needed more. I wrote about RAM specifically for those who give such advice, so they don't point to some kind of memory shortage. And I still have the swap file from Assassin's Creed Valhalla, where even for it, the recommended specs are 16 GB in 4K on ultra settings.
After 5-7 hours of playing, a memory leak due to an open browser, in which I was looking up walkthrough secrets, ate up everything. In games, my RAM is never fully utilized; it's the video memory that's being used, and I have 12 GB of that. The swap file on an NVMe SSD M.2 is as fast as a second RAM module in terms of response time and as large as 20 RAM sticks.
This amount of RAM is only used up either due to poor game optimization or a large number of open browser tabs. When the developers were making Heroes, they couldn't even imagine that there would be such large amounts of RAM, and mass sales of SSDs were still at least 5-7 years away.
And a large portion of the "helpers'" answers on the internet date back to those ancient times. What kind of faulty memory is to blame for a game from 2006? The game's authors themselves probably had at most 2 sticks of 4 GB of DDR2, and DDR3 didn't appear until a year later, in 2007. 🙃 So, forget this nonsense about the game crashing due to a lack of RAM! This misconception has been circulating on the internet since the days when everyone was using Windows XP, and Vista appeared a year after the game.
What mods? What are you talking about? I wrote about playing without mods. What about 100500 saves, what about custom maps in Maps or UserCampaigns? Look at the year I registered on the site; am I new here? When playing Heroes, everyone makes a quick save before each battle and a couple of full saves just in case. Why do I need to be told such obvious things? I just want those who know what they're doing to get to the bottom of the problem. It's clear that the problem lies in the game. And I hope that the author has, after all, created a map of this size and found a way around the problem.
Всегда играю на Г.