I am using unity 5.2.4f1 - my game when exported in webPlayer is 15.8meg - that is very low.
I can’t find what memory size i should use, when i am at 1024 meg I am too high, and when i am at 768meg i am too low.
So the question is:
Is there a way to calculate mathematicaly the perfect/optimal memory size ?
thx.
Edit:
I am running the game with 800meg - it crashes time to time, but the strange thing that when i attach the profiler with the webGL game it gives me:
Used total: 81.3meg
reserved total: 89.4meg
I had to debug a memory leak on a WebGL build, and ended up logging memory allocations by editing the Emscripten-generated “dynamicAlloc” function in the resulting JavaScript file. Remember that it is far easier to edit a development build as the resulting code is somewhat legible.
Simply add a few console logs in the correct function, so it looks like:
This way, you’ll have a notice everytime memory grows (a lot at first, but it will quickly slow when you’re near the maximum used memory). It is then a simple matter of putting a reasonable value (the value of the “ret” variable plus some padding) and you should be set.
I did remove a few assets, so the project is even lighter, then i updated my ram from 4gigs to 8gigs.
I can now launch the players on firefox with a memory size at 450!
Now i dont know what exactly did the trick, memory update or asset cleaning…
for now it works at least. if i get more information i will keep you informed.