I am the original author of this Plugin.
There seems to be some confusion as to what this Plugin actually does.
@brandos came to me after noticing a large amount of operating system memory being paged about when switching maps and opening/closing the menu whilst having parallaxes in use - a typical sign of a memory leak. There also seemed to be high CPU usage during these events.
I alleviated the leak by caching the most recently visited map spritesets, this is the "Cache Size" parameter. It is default to 5 as that was how many maps brandos estimated the player would switch between for their particular project.
So each time you close the menu or revisit a map the spriteset, along with the parallax map, will be loaded from this new cache system. This helps with load times quite a bit, at the expense of increased memory consumption - however it alleviates the tilingTexture memory leak occurring for the cached maps.
It took further investigation to see what was happening with tilingTexture. A bug in MV causes the key to the texture in PIXI.js' BaseTextureCache to be lost as each time a parallax map is loaded the key used to retrieve the tilingTexture from the cache is lost and replaced with a new key, causing tilingTextures to build up in the cache unused. Due to the size of tilingTextures with parallaxes in memory this builds up drastically very quickly and the client loses performance rapidly (especially going in and out of the menu).
I wrote a quick fix with Spriteset_Map.prototype.cleanupLeaks that simply cleans up the cached texture and deletes the entry from the BaseTextureCache (this is better than nulling the entry as the space in the cache itself is made invalid with the delete operator). This is called when the cache fills up and a new map is loaded.
This plugin does not attempt to fix any problems with Node.js memory leaks. Just keeps the cache in check and prevents the constant reloading of map data and parallaxes between Scene transitions by storing the most recent spritesetMap in memory.
There is one thing not stored; event sprites seem to get disconnected from their events if you load them from cache. This can be fixed properly, but for the current version this Plugin will remove and recreate event sprites.
The Cache Size parameter should be used to balance memory consumption against CPU usage. If you want less memory consumed, set it to a low value. If you want less clean-up to occur (changing maps frequently) then set it to a higher value.
If you believe you have infinite memory then you can set the Cache Size to zero and nothing will be freed (memory will forever build up until the cache is flushed). This may be preferable for games with only a handful of maps.
The SpritesetMapCache flush command will clear the cache, which may be CPU intensive. The best time to do this would be after a number of large parallaxes have been loaded across different maps but the player is going to spend a lengthy amount of time on a less memory intense map (perhaps visiting a tiled world map after going through a town made of several parallax maps?).
Even after a tilingTexture fix is released, this Plugin should still prevent intense CPU usage and large deallocations/allocations occurring when opening/closing the menu and switching maps.