The City pic is created when the device goes through your entire town taking screenshots, then it assembles them into a single image. One time I actually saw the process glitch, so it was displaying this process on the screen. It was just jumping around my town. It takes a LOT of screenshots before assembling them. So I can imagine some Dev set a minimum requirement to take them and hold them in a temporary folder, plus have enough memory muscle left to correctly assemble and match all their edges. They must have set 9gb for your device model. Each model may be different.
But RAM has always been different than ROM on computers, and mobile devices are very similarly structured. What we need is more available RAM, the working memory. Usually on PCs we can designate additional ROM to become available as virtual RAM. So it's just some value that's set by us or itself. If we can increase that value, that would be a solution. Basically, not emptying the cache; but making it larger.
But usually emptying the cache folder is sufficient. Android lets you do it in the storage settings. There's a breakdown of what's in storage, and just tapping the cache value offers a chance to empty it. I wish iOS offered this somehow but idk