The-International-Screeps-Bot / The-International-Open-Source

An automated bot for the coding game Screeps.com
MIT License
104 stars 35 forks source link

Actions to significantly reduce heap usage #774

Closed CarsonBurke closed 5 months ago

CarsonBurke commented 9 months ago

General Problem

High heap usage seems to have a huge adverse effect on our CPU usage.

image

Solutions

Suspected heap leakage

data, such as cost matrixes and other properties of RoomManager and CommuneManager are likely being assigned when there is vision and then not deleted as intended next tick or some ticks thereafter. Therefore, data likely sits in those managers until the room is seen again and some of it is cleaned up (and more added, perhaps) or alternatively, heap resets. This probably does an effective job of explaining the incremental increase in heap over an extended period until it is maxed out

CarsonBurke commented 9 months ago

If anyone else has ideas on what we can do to diminish our heap utilization while maintaining or improving CPU and memory efficiency, please let it be known