That would make more sense honestly. BUT....I've seen much smaller images in parallax in RPGMaker need more than what you claim so something else is at work then, as I've seen smaller images need 8 GB or more.
For what it's worth, I went ahead and ran a test just now. I used the random dungeon generator thingy to make a 256 x 256 tile map. I then used OrangeMapshotMZ to export that map as a PNG, and then I made a (1 layer) parallax map with it, using Galv Layer Graphics.
When I loaded up the game and went into the tile map version of the map, my game was using 353 MB total (in the task manager). Then I went into the parallax map version of the map, and my game was using 909 MB. So there was a 556 MB difference between the two maps. Not too far off from my calculation of 576 (the minor discrepancy probably involved unrelated objects having been freed by the garbage collector at some point inbetween me changing maps).
"576 MB isn't anything too crazy, in and of itself. However, people usually split their parallax maps into multiple layers, and each of those layers would use 576 MB. So say it's a 4 layer map (ground, shadow, light, and overlay), then we're looking at 576 MB x 4 ≈ 2.3 GB."
you mean tiled map, dont you ?
No. I was talking about parallax maps. Tile maps don't really use much RAM, regardless of size.
"JavaScript doesn't have any way for a developer to explicitly/immediately free memory from unused objects--you're at the mercy of the Garbage Collector, which you cant necessarily predict or control.
This means that, for a period of time, you could have multiple maps consuming memory at the same time."
how to solve this ? write an app to run with the game ?
For the most part, you kinda can't. If you're using NW.js (meaning not a web of mobile deployment), you can run the game with a certain flag enabled, which will allow you to manually call the garbage collector. But it's not a perfect solution, and it's probably not something you should mess with if you don't know what you're doing.
It's not something you usually need to worry about too much, since the garbage collector will *usually* clean up unused objects pretty fast. But if you're dealing with single objects that are over 500 MB each, and could potentially be created/released in rapid succession, then it could be cause for concern. So I guess that the best way to solve the problem is just *don't* use massive parallax maps.
loading screen wont solve it, will it ?
why the hell the menu does that sheet ?
Players tend to not worry about a bit of loading time between map transfers. They're kinda used to it, and so they won't notice so much. But if there is a delay when closing the menu, they will notice that.
Entering the menu requires you to switch from the map scene to the menu scene. So then when you exit the menu, it switches back to the map scene. If a plugin doesn't handle that scenario properly, then it might re-load the map image when you switch back to the map scene.
Galv Layer Graphics handles the menu thing properly, so it's not an issue. But I have seen a plugin (VisuStella's Visual Parallaxes) that doesn't handle it properly, and causes lag and RAM spikes each time you close the menu (when you're on a large map).