Screeps3D icon indicating copy to clipboard operation
Screeps3D copied to clipboard

High Memory usage after exploration of multiple rooms

Open thmsndk opened this issue 5 years ago • 4 comments

KittyTack on slack reported the following When exploring around on MMO the used memory on the system skyrockets, it never seems to unload /unsubscribe the rooms not visible from memory.

KittyTack suggested a button to "unload" all rooms except the ones around your current location.

We need to investigate the memory usage point.

thmsndk avatar Jun 30 '19 13:06 thmsndk

One of the things that may be able to help with this is setting static limits on objects like dots and pooling them. At a certain number, recycle the last one on the pool to the first by changing the values. Also setting the visual objects to setActive('false') can help out with out of range object in the pool.

ssmith151 avatar Jul 02 '19 17:07 ssmith151

I believe room objects are already pooled, not sure about dots

Robalian avatar Jul 04 '19 11:07 Robalian

Room views seem to add up indefinitely. So terrain data and road network data. Maybe we should limit their amount to some fixed value, with the least recent ones being unloaded?

Robalian avatar Jul 09 '19 00:07 Robalian

Limiting it might be a good idea, we also have a maximum viewing distance in the client, not sure how views add up comparted to that? maybe we should unload views that are too far away to be seen? I have no idea if it already does this :)

thmsndk avatar Jul 10 '19 22:07 thmsndk