frederik's blog

Music (5) Projects (2) Snippets (8) Technology (5) Thoughts (9)

Speak×

XML file freezes browser & crashes computer

!
/ (last edited)

A short anecdote about modern web browsers (Firefox specifically) being stupid as fuck when it comes to loading and rendering big XML files.

While working on a tool for viewing HTML entities in an accessible format I discovered the official Unicode XML dataset (v10). It’s very complex, compared to a typical sitemap.xml or something like that. The Unicode XML file has a size of ~180MB – I admit that’s pretty big for a “plain text” file.

Opening the file in Firefox “Quantum” 59.0.2 (64-bit) froze my computer within a couple of seconds. Mouse and keyboard input didn’t work anymore, CPU utilization went up to 100% on both cores (G4400) and I had to reset my computer.

I couldn’t believe it. Crashing my Linux box is really difficult since Solus OS is generally very stable. I blamed Firefox at first. Then, to be sure, I tried the XML file with all the other popular browsers that I can install on Solus OS.

  • Chrome – doesn’t hang the computer but never finishes loading
  • Chromium – same as Chrome
  • Opera – doesn’t hang the computer entirely but overall performance becomes choppy after a few seconds
  • Vivaldi – freezes computer just like Firefox does (but it takes longer to do so)
  • Midori – doesn’t hang the computer but never finishes loading
  • Falkon – same as Midori

The verdict is in: Opening XML files with a browser sucks. At least if it has 100.000+ entries.

Although none of the tested browsers managed to actually open and display the XML file I can only blame Firefox for the initial crash. There should be some mechanism in place to prevent a freeze.

Chrome/Chromium do not only not crash, those two browsers also conserve my machine’s resources. CPU utilization hovers around 30-40% and I can continue working on other things. Waiting for the XML file to be parsed in its entirety is fruitless, nonetheless.

Update: I forgot to add the relevant bug reports which date back up to 15 (!) years and are still not resolved. (It’s obviously not an OS problem. Windows is affected as well.)