title: Why does simple website crash on mobile (iOS Safari and Chrome, at least)?
body: <p>I have a website that is very simple, but very long -- a lot of text that could be scrolled through. It's a documentation site, and considering the nature of the content (a lot of short similar entries) I decided to show everything at once, so the user could either scroll from entry to entry or navigate via a sidebar index. It's a common documentation model that I like (e.g. <a href="http://underscorejs.org/">Underscore</a>, <a href="http://backbonejs.org/">Backbone</a>, and <a href="http://lodash.com/docs">LoDash</a>).</p>
  
  <p>The site is here: <a href="http://davidtheclark.github.io/scut/">http://davidtheclark.github.io/scut/</a>. You could look at the pre-production code here: <a href="https://github.com/davidtheclark/scut/tree/master/docs/dev">https://github.com/davidtheclark/scut/tree/master/docs/dev</a>.</p>
  
  <p>And here's the problem: <em>For a number of users this site consistently crashes their iOS browsers</em>. Not all users (not me); but for those that <em>do</em> experience the crash, it seems to recur consistently. (The site may also crash some people's Android phones, I don't know: haven't heard from any Android users.) <em>I am hoping someone can help me diagnose and possibly fix this problem.</em></p>
  
  <p>Part of the difficulty I have is that I cannot reproduce the crash myself -- not on my own iOS devices, not on the Xcode simulators. Because the site is not at all resource-heavy (~70KB load) and involves very little JavaScript, and because of the effects of a few prior attempts to fix this, <em>I'm guessing that the problem involves memory usage</em> -- that iOS browsers are crashing because the site is demanding too much memory. But I'm not <em>sure</em> that's the issue, and if it is I'm not sure how I can fix it.</p>
  
  <p>I'm not sure what to try next, and I'm hoping some savvy StackOverflow whizzes have advice. What is it about this site, which seems so simple and basic to my eyes, that is making it so memory-demanding that it is crashing browsers?</p>
  
  <p>Is it just too long? Is there CSS that is too difficult to render? Are there JavaScript memory leaks?</p>
  
  <p>I'm interested both for the sake of this particular site and so that I can learn to anticipate-and-prevent and/or diagnose-and-fix similar problems on other sites in the future.</p>
  
  <p>Feel free to look at or contribute to [the Github issue](<a href="https://github.com/davidtheclark/scut/issues/110">in this Github issue</a>, as well.</p>
  
  <h2>Addendum</h2>
  
  <p>Here are some things to know about the site that might be relevant:</p>
  
  <ul>
  <li>The HTML doc is <em>large</em> relative to other sites' HTML docs. Unminified it looks to be ~225KB. (I notice that LoDash docs are even bigger -- does that site crash people's phones?)</li>
  <li>The served HTML doc is minified.</li>
  <li>Served CSS and JS are also minified.</li>
  <li>The site uses <a href="http://prismjs.com/">Prism.js</a> for syntax highlighting.</li>
  <li>The site uses <a href="https://github.com/filamentgroup/Overthrow">Overthrow</a> to make the 2-scrolling-columns layout work on tablets.</li>
  <li><code>&lt;aside id="help-content"&gt;</code> is fixed and translated off-screen; it slides in when you click a [?] like the one by any utility's "use-name".</li>
  </ul>
  
  <h2>An iOS Crash Log</h2>
  
  <p>These look to me to be the potentially relevant lines of a crash report from an iPhone running Chrome and crashing on the site (I'm not sure whether they are actually relevant or not because I haven't developed iOS apps and don't know the ins-and-outs of these reports):</p>
  
  <pre><code>Free pages:                              5674
  Active pages:                            117674
  Inactive pages:                          55121
  Speculative pages:                       3429
  Throttled pages:                         0
  Purgeable pages:                         0
  Wired pages:                             60906
  File-backed pages:                       23821
  Anonymous pages:                         152403
  Compressions:                            356216
  Decompressions:                          121241
  Compressor Size:                         16403
  Uncompressed Pages in Compressor:        49228
  Largest process:   Chrome
  
  [...]
  
  Chrome &amp;lt;2a759438c2253e3baededaa0d13feb56&amp;gt;       166479           166479  200  [per-process-limit] (frontmost) (resume)
  </code></pre>