Open In App

HTTP headers | Large-Allocation

Last Updated : 27 May, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

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. 

Syntax: 
 

Large-Allocation: <megabytes>

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 
 

Examples: 
 

  • In this example the size of the allocation is not certain. 
     
Large-Allocation: 0
  • In this example, the size of the allocation that is about to be performed is 2000 megabytes. 
     
Large-Allocation: 2000

Supported Browsers: The browsers are compatible with HTTP Large-Allocation header are listed below: 
 

  • Firefox 53

 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads