Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Using too much memory

Discussion in 'WebGL' started by Smaika, May 18, 2016.

  1. Smaika

    Smaika

    Joined:
    Apr 28, 2014
    Posts:
    13
    So I create a 3D endless game and build it for Webgl and you can check it here (run the game and take a look at the memory usage from the task manager)
    https://dl.dropboxusercontent.com/u/103586730/RollBall!/index.html

    The problem is its using 450+MB of memory it even reaches 500 and more that's 0.5GB what is wrong is it my code note that if you checked the game out I did try to stop the generation of the floors and still it only dropped less than 50MB, So I tried to disable every thing in the scene (Except the camera) and still it uses about 300MB
    then I tried to only enable the generation of the floors and now it uses 390MB so it could possibly be the generation of the floors is what causing it to use that much so I'll figure out another way to generate the floor but an empty scene using 300MB that is a big problem.

    I have read an article here http://forum.unity3d.com/threads/webgl-roadmap.334408/ and it said that JavaScript require a lot of memory and since I use JavaScript for this game could it be the reason and if I spend my next 2 weeks to translate it to C# all of this issue can be from the past? What do you think can be the reason? And how to fix it?

    Basically how to properly optimize an WebGl game?

    Using Unity 5.3.4p6
     
    Last edited: May 18, 2016
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Currently it's quite common that Unity webgl content requires several hundred megs of memory. Anyway, have you tried to profile your webgl memory usage with the Unity Profiler ?