@Sainse Technically - the game can use up to 4GB of memory - but - due to the way that lua handles memory, the limit is about half of that. At some point, the number of units becomes the main reason that memory usage grows to that point (around 2GB) - and it will then simply crash to desktop.
The size of the map, and the number of units in the game, and to a lesser degree, the number of wrecks and props, contribute to the overall memory usage, for the main part. After that, the AI (and the number of them involved) plays the largest role in how memory is used up.