HTTP headers | Large-Allocation
The HTTP Large-Allocation header is a response-type header that informs supported browsers (currently only Firefox) about the needs of a memory that allows them to make sure that the large-allocation succeeds and also start a new process using some unfragmented memory. This proves useful when the memory gets over when the browser tries to allocate the Unity heap. Large contiguous blocks of allocated memory can be used bu asm.js or webAssembly applications. Like online games, this header basically informs the client browsers that the to-be-loaded is going to perform a large contiguous memory allocation so that the browsers can react to that future performance be prepared.
Note: Sending Large-Allocation header other browsers rather than firefox does not mean anything incorrect.
Directives: The HTTML Large-Allocation header accepts a single directive as mentioned above and described below:
- <megabytes>: This directive represent the value in megabytes that specifies the approximate size of the allocation that is about to be performed. Its value is 0 if the size is uncertain.
Troubleshooting Errors: If this header is not used properly then it throws error messages or warnings like the following:
- An error could show up if the page reloaded itself into a new process which should have a more memory.
- An error could show up if the browser tries to load a document with a non-GET HTTP header.
- An error could show up if the browser does not open a document at the top level of a tab or a window opened by the user.
- An error could show up if this header was ignored by the document because of not loading the document out of the process.
- An error could show up if the user is running a non-win32 version of Firefox.
To check the Large-Allocation header, go to Inspect Element -> Network. Check the response header like below
- In this example the size of the allocation is not certain.
- In this example, the size of the allocation that is about to be performed is 2000 megabytes.
Supported Browsers: The browsers are compatible with HTTP Large-Allocation header are listed below:
- Firefox 53