Webtorrent-desktop: Common error: Array buffer allocation failed

Created on 2 Sep 2016  路  6Comments  路  Source: webtorrent/webtorrent-desktop

See https://github.com/feross/webtorrent/issues/895 for details.

Can we package a 64-bit version in addition to the 32-bit Windows app?

This bug only happens on Windows. It has happened 100s of times in the telemetry, always on Windows. Our Windows packager creates a 32-bit executable, so we only get 4GB of address space, even tho the vast majority of our users are using 64 bit hardware. This is probably part of the problem.

@grunjol @feross

bug

Most helpful comment

The latest telemetry logs show that the "Array buffer allocation failed" has disappeared from the Top 10 errors list!

All 6 comments

It would be really nice to just go 64-bit only. Maybe the 32-bit usage will be low enough in a year? Right now, this is the breakdown according to Steam's stats:

screen shot 2016-09-14 at 4 48 07 pm

The most important stats are:

  • ~6% of users on Windows 7 (32-bit)
  • ~1.5% on Windows 10 (32-bit).

Would be interesting to see what the breakdown of our users is -- more or less than Steam?

The problem with offering two versions is that it's really confusing for users to pick the right one. We can get away with that for Linux users because they're usually pretty technically saavy.

So, if we offer 32-bit as the default, and let users select 64-bit if they want (like we do for Linux, to err on the safe side), then most users will still experience the "Array buffer allocation failed" issue. Not ideal.

For comparison: Atom ships 32-bit only. Slack ships a 32-bit, but detects if the user is on 64-bit and sets a different auto-update URL so they'll get updated to 64-bit eventually.

Here's an approach I like: Make a 64-bit Windows build. Offer 32-bit vs 64-bit installer based on the platform indicated by the browser. I just played around with this a bit and it looks like it can be pretty reliable:

https://github.com/feross/arch

In the browser, there is no spec that defines where this information lives, so we check all known locations including navigator.userAgent, navigator.platform, and navigator.cpuClass to make a best guess.

If there is no affirmative indication that the architecture is 64-bit, then 32-bit will be assumed. This is perfect for determining what installer executable to offer to desktop app users. If there is ambiguity, then the user will get the 32-bit installer, which will work fine even for a user with a 64-bit OS.

And like Slack does, users with a 64-bit OS who accidentally install a 32-bit version of the app (due to a mistake in the browser auto-detection, or other error) will get auto-updated to 64-bit eventually.

Here's a PR implementing architecture detection for the Linux builds. (Right now, we serve 64-bit to all Linux users)

https://github.com/feross/webtorrent-www/pull/100

This impact of this issue should be reduced by 90%+ now, since that's the proportion of users that are on Windows 64-bit. These users will be automatically upgraded to a 64-bit WebTorrent app in the next release (Specifically, the release AFTER v0.16.0.)

Closing this for now. We can re-open this if the error shows up in our top errors again.

The latest telemetry logs show that the "Array buffer allocation failed" has disappeared from the Top 10 errors list!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shauryasehgal picture shauryasehgal  路  5Comments

izdi picture izdi  路  6Comments

npyl picture npyl  路  4Comments

DiegoRBaquero picture DiegoRBaquero  路  6Comments

gabrieldesouza picture gabrieldesouza  路  4Comments