Question about Map changes and Image Cache

Hello everybody,
can somebody enlighten me why the ImageManager cache has to be cleared every time a map is changed?
That evades me...

Cache clearing is called from Scene_Map.onTransfer, which is called everytime a map is created,
which happens everytime SceneManager.goto calls a map. Am i missing something here?
I just deactivated that in my project for the time being and it doesn't seem to cause errors,
but doesn't reload images everytime the map is changed.

Found this while isung the visustella core plugin and preloading faces, which were not there anymore
when switching maps. I wrote me a test plugin that loaded every png file in faces at game start and had
the same experience, no faces when switching maps.
MZ's image cache is cleared on map transfer, instead of being based on size like in MV.

If it didn't get cleared now and then, the game could potentially end up using a lot of RAM, particularly for games that use a lot of pictures, e.g. parallax mapping. It depends on your game.

Preloader plugins typically implement a separate cache system.
A new map means new tilesets, possibly a new background and possibly entirely different event sprites. Keeping those images from the previous map in cache when they will probably no longer be needed would use up quite a bit of the cache.
Ah ok thanks 🙂 i'll just implement the mv variant then for my project... else the images are not loaded fast enough when i change them on armor changes in the menu. I tried a few of the preloaders and they all need me to input every single file, so i have to input around 50 files and change them everytime a new armor is introduced in my project 😛

Update:
Ok, tested it out, and it won't even crash on me if i throw insane amounts of data at it when disabling cache clearing (tried preloading 2.3GB Images and adding 2 million integer variables, and it still is around 3.5GB memory usage) and it doesn't need to reload images that much, which possibly helps wear and energy consumption on smartphones and solid state drives. But found a way changing 2 lines of code for the faces, characters and potentially pictures to keep loaded permanently and everything other to get flushed on map change

Update 2:
Thread can be closed, made a plugin to adress some of the parts i didn't like about the cache system.

Original thread: https://forums.rpgmakerweb.com/threads/question-about-map-changes-and-image-cache.156237/