pub fn get_heap_statistics() -> HeapStatistics
Get information about your script’s memory heap usage.
Screeps documentation