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 /
avatar image
2
Question by N-Dream-AG · Jun 17, 2016 at 09:21 PM · webglmemory

Memory settings for WebGL content: Array Buffer Allocation Failed vs. Out of Memory Exception

I am struggling with choosing the right memory size for my WebGL game Silly World Series. I've read all unity answers threads I could find on the topic of WebGL Build memory size, but I have some questions.

For the record, my WebGL Memory Size is currently set to 400Mb.

Error Messages

My game is live in the AirConsole store and has been played about 300 times since I uploaded it yesterday. We have a tool (developers console) that saves javaScript errors that users experience, to help us track issues. The tool reports the following errors:

Uncaught RangeError: Array buffer allocation failed

Occurred in 23 cases / ~5%

Screenshot of Error Message

To make sure I get this right: This error occurs when the content is loading, and the browser tries to allocate 400mb of memory, but the browser says "Nope, can't give you that much." Is that correct?

Uncaught Exception: Out of Memory

Occurred in 7 cases / ~1%

Screenshot of Error Message

Again, to make sure I understand correctly: this is what shows up when the game is running, but the 400mb aren't enough to run it anymore. Correct?

Uncaught RangeError: Invalid Array Buffer Length

Occurred in 8 cases / ~1%

Screenshot of Error Message

I have no idea what this one is about. Any ideas?

Weird issues / Inconsistencies

  • Someone tried to play the game using Firefox on Windows 8.1 and a powerful gaming PC. They got a message saying "The browser could not allocate enough memory for the WebGL Content", which I assume is what shows up as "Array Buffer allocation failed" in my dev tool. (Using Chrome on the same PC worked)
    Which factors determine how much memory Firefox can allocate? Because we've tested it using Firefox on a Macbook Pro and had no memory issues. Is there a setting for how much memory the browser can allocate?

  • When testing on our Macbook Pros, we've never run into any "out of memory" issues (regardless of browser), even with a smaller memory size than 400mb. On my coworker's Macbook Air however, the game runs out of memory halfway through. I realize that the game might not always use the exact same amount of memory, but since it happens consistently on one computer and never on the other, I wonder: Why would the 400mb be enough on one computer but not the other?

.

Solutions?

  • Since it's very frustrating for players to start playing the game and then running out of memory, I am more inclined to increase the memory size: I'd rather people know if they can run the game at the beginning, instead of getting interrupted halfway through.
    However: The more content I add, the bigger the memory will have to be, the fewer people will be able to play my game - is that something I just have to accept or can I do anything about it?

  • What can I do to reduce memory usage? I'm pooling objects and caching variables as best I can. What other things have an impact on how much memory my game will need? (For the record: code stripping is enabled, I'm making 'fastest' builds, import settings of textures etc. are set to 'compressed' and appropriate sizes...)

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 N-Dream-AG · Jun 23, 2016 at 08:31 AM 0
Share

I have discovered (in the UnityLoader.js file) that I've misinterpreted the meaning of the "out of memory" message. Getting "out of memory" (lowercase o) as an error message is the exact opposite of a user getting "Out of memory" (uppercase O) as an alert.

The three error messages "out of memory", "invalid array buffer length" and "array buffer allocation failed" seem to all mean the exact same thing, different browsers/user agents merely send it in a different way. For any of these three messages, the alert shown to the user is: "The browser could not allocate enough memory for the WebGL content. If you are the developer of this content, try allocating less memory to your WebGL build in the WebGL player settings."

On the other hand, if there was really an issue of there being too little memory allocated, it would show up in my console with the message "Cannot enlarge memory arrays", and show the user an alert saying "Out of memory. If you are the developer of this content, try allocating more memory to your WebGL build in the WebGL player settings."
This has never happened with my project, meaning I can probably use less memory than the 400mb I've been allocating.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Marco-Trivellato · Dec 05, 2016 at 05:31 PM

Have a look at these blog posts:

  • Understanding Memory in Unity WebGL

  • Unity WebGL Memory: The Unity Heap

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

6 People are following this question.

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

Related Questions

WebGL memory size in Player Settings? 2 Answers

WebGL Build Out of Memory Github Pages Not on Local Host 0 Answers

I have this out of memory issue when running my webgl game in iOS. 0 Answers

Not able to load large obj Files in Unity Webgl 0 Answers

Unity WebGL build memory discrepancy in local hosted and web hosted 0 Answers


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