2
\$\begingroup\$

I am getting aw snap or sometime not enough memory problem when I reload my webgl page. I have a webgl project which is empty (just a camera + light), developed in unity3d. I am reloading it, and profile its memory. enter image description here

As you can see that its load 1.2MB in the first load than 1281 MB in second then 1574 then 2160 and then get crash. I am amazed that why it is happening?

Another source of memory-related problems is the IndexedDB filesystem used by Unity. Any time you cache an asset bundle or use any filesystem-related methods, they are stored in a virtual filesystem backed by IndexedDB.

What you might not realize is that this virtual filesystem is loaded into and persisted in memory as soon as your Unity application starts. This means that if you are using the default Unity caching mechanism for Asset Bundles, you are adding the size of all of those bundles to the memory requirements for your game, even if they are not being loaded.

but the problem is I didn't load anything from this build yet.

Even when I try to refresh my empty project several time in chrome I get this error: enter image description here

For Mozilla, there is an error log which states failed to asynchronously prepare wasm: out of memory enter image description here

\$\endgroup\$

2 Answers 2

0
\$\begingroup\$

It would help if you added a link to a git repository, or some code samples.

Without seeing your code or project, check what packages, plugins and other imports have been added to your project. Verify that your project's assets only contains things that you need, and remove everything that is unnecessary.

\$\endgroup\$
0
\$\begingroup\$

I have resolved this error, thanks to unity. It was related to web browser console open. When the dev tools are open, chrome keep increment the memory on page reload. While the problem is still persist with firefox. I found that FireFox has default behaviou that it increment the memory when you page reload.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .