June 9, 2023

Urban Tech Story | How Firefox improves stability on the Windows platform

Memory issues are the main cause of crashes in Firefox for Windows. Applications running on Windows are more likely to run out of memory than programs on other operating systems, and this has to do with the way Windows handles memory. Modern operating systems allow applications to allocate an address space, and when an application uses its reserved address space, the system backs it with a piece of physical memory, swapping some existing data if necessary. Both Linux and macOS work this way, but Windows has an extra step. It requires an application to submit a usage range before requesting use of its reserved address space, ensuring that the system can find available physical memory. For this reason, Windows limits the amount of committed memory to the sum of physical memory and the size of the swap file. This commit space is a hard limit that applications face. When this limit is reached, memory allocation fails. When Firefox developers analyzed browser crashes, they found that there was still a lot of available physical memory on the user’s machine, but the commit space was exhausted. They don’t know why this happens, but think they can circumvent this problem with some tricks: When memory allocation fails, instead of crashing immediately, the browser waits and then tries to reallocate memory. This causes the browser to freeze for a brief fraction of a second, but is much better than crashing. This trick was implemented in Firefox 105, significantly improving the stability of the browser.


Ewen Eagle

I am the founder of Urbantechstory, a Technology based blog. where you find all kinds of trending technology, gaming news, and much more.

View all posts by Ewen Eagle →

Leave a Reply

Your email address will not be published.