Couple of minor improvements that can be done to CompilationMemoryStatistic:
1. Display arena usage for all existing types of arenas. Currently Arena tag has these four possible values:
enum class Tag : uint8_t {
tag_other = 0,
tag_ra, // resource area
tag_ha, // handle area
tag_node // C2 Node arena
};
and CompilationMemoryStatistic only displays usage for "tag_ra" and "tag_node" arenas. CompilationMemoryStatistic can be updated to display arena usage for all the tags.
In future we can build up on this to add more tags to categorize other usages of arenas to get a more complete picture during compilation.
2. Collect arena usage only after compilation has started. This would remove the need to separately track the arena usage at the time when the compilation has started.