Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
2
Question by Bilelmnasser · Sep 24, 2015 at 06:18 PM · webglramallocation

Why when i increase memory allocation for Webgl , my game gone crazy and take more away RAM on Browsers?

hi all Unity developpers , something weird ihave been seeing, for example when i allocate 512mo , my real RAM on browser Ram is about 1024mo !!! but when i put 128 mo , my real ram comsuption is about 600/700 mo, why this is hapening ? even tho the game works ? is this a bug or am i the only one seeing this wierd stuff ? thank you all

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MrGuardianX · Aug 08, 2016 at 12:45 PM 0
Share

Exactly my issue. We have a game which consumes about 300-500$$anonymous$$B of memory on movile devices. While in Chrome it is larger than 1GB!!! I tried all of the combinations proposed here and they are really useless.

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by vladrybak · Sep 26, 2015 at 10:53 AM

Before build

  1. Set Optimization Level to “Fastest”

  2. Set “Enable Exceptions” in Player Settings to “None”

  3. Enable code Stripping” in Player Settings.

  4. Take care when using third-party managed dlls, as those may drag in a lot of dependencies and increase the emitted code size significantly.

  5. Don't use LoadFromCacheOrDownload function for asset bundles

  6. WebGL Memory size should be set to value that you expect from your game and should be as small as possible. You can check your current memory allocation in Editor Profiler and make WebGL size a little larger.

After Deploy

  1. Make sure that your server use Compressed files instead of the much larger “Release” folder, as the http protocol natively supports gzip compression (which is faster then Unity could handle decompression by itself in JavaScript code). You can check that by loading your content and inspecting network transfers in your browsers development tools. You should find “Content-Encoding: gzip” in the response headers for the js and data downloads. If you are hosting your files on an Apache web server, Unity will write an invisible .htaccess file into the build results folder, which tells Apache to compress the transfers, so this should just work. If you are using other web servers, check your server’s manual.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by vladrybak · Sep 25, 2015 at 07:57 AM

It's expected behavior for webgl. Here is a docs about it http://docs.unity3d.com/Manual/webgl-memory.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by Jessespike · Sep 24, 2015 at 07:22 PM

Increasing the WebGL Memory size will directly increase the amount of memory used by the browser. Browsers handle memory for webgl in a less than ideal way, creating duplicates, etc. So it bloats. Looking at the memory consumed by the browser via task manager probably isn't the best way to gauge apps.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

30 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Out of memory error 0 Answers

WEBGL memory usage 1 Answer

(URGENT!!!!!!!!!) WebGL out of memory no matter how much I allocate. [C#] 1 Answer

WebGL and Access-Control-Allow-Origin 1 Answer

Correctly configuring IIS7 to serve gzipped content. How. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges