I remember seeing this thread awhile ago: Memory Tools in MakeCode Arcade… which links to this documentation: https://makecode.com/js/profiling#profiling-memory
I don’t know if this still reflects the state-of-the-art for memory profiling in arcade.
… oh, and I just remembered I think I happened to see @mmoskal demoing it once (a small clip buried inside of a much longer video): https://youtu.be/BOzQkxohTIs?t=343