Unity WebGL heap memory usage tracking
Hello everyone,
As many other Unity WebGL developers I am concerned about how much memory should I allocate for my game. I know, that I can do a lot of builds with different amounts of memory and test them on all the different laptops that exist, but this approach is not that good.
On January 2017 kongregate posted a very nice article about this.
They use TOTAL_MEMORY, TOTAL_STACK, STATICTOP, STATIC_BASE, DYNAMICTOP and DYNAMIC_BASE to calculate how much memory is actually used.
In my case I found access to gameInstance.Module.TOTAL_MEMORY, but don't know where to find other variables.
Where can I find them, or is there another way to track this?
P.S. Seems like System.GC.GetTotalMemory(false) is not the correct answer.
Your answer
![](https://koobas.hobune.stream/wayback/20220612143236im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Need help with Memory management with Electron app using Unity WebGL Build 0 Answers
WebGL freezes until memory is allocated (20 seconds) 0 Answers
WebGl project memory usage 1 Answer
unity not removing unsed objects 0 Answers
Where to set Total_Memory? 0 Answers