You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript/WASM now supports 64-bit WASM. The canonical builds continue to be 32-bit but creating one's own 64-bit build is now as simple as running "make".
It would be a big deal if databases can now go beyond the 2GB cap, though other options may need to be changed too. That would solve my biggest painpoint with the wasm version.
These bindings are not limited to 2gb dbs. Emscripten, however, caps the heap at 2gb, even in 64-bit builds. When using OPFS storage, you can store much more than 2GB (but doing so is ill-advised, as OPFS is, all marketing to the contrary, transient in nature, able to be wiped at the browser's whim).
Version 3.51 supports Emscripten 64-bit builds in all of its supported configurations. It DOES NOT support node (and will never do so without a generous long-term financial backer to cover the effort).
On both Chrome for Android and Safari for iOS (17+), installed PWAs are granted persistent or effectively persistent storage. Their OPFS data is not wiped automatically — unless the user deletes the app or the device runs critically low on space.
It could, i guess, but we don't distribute 64-bit builds and, after a team discussion, have no immediate plans to. You're welcome to build one with only a tiny makefile tweak to see MAXIMUM_MEMORY, but if you're using the npm then you're presumably not building your own.
On both Chrome for Android and Safari for iOS (17+), installed PWAs are granted persistent or effectively persistent storage. Their OPFS data is not wiped automatically — unless the user deletes the app or the device runs critically low on space.
Installed PWAs represent a diminishingly small subset of OPFS clients. For every other client, a browser update and/or hiccup can cause OPFS to be wiped.
If the team considers distributing 64-bit builds in the future, I think that would be a good opportunity to look into increasing the MAXIMUM_MEMORY to support larger database files too.
It seems the maximum limit for the JS API is 16gb.
I think it’d be worth revisiting in the future when Safari adds support for Memory64.
It could, i guess, but we don't distribute 64-bit builds and, after a team discussion, have no immediate plans to. You're welcome to build one with only a tiny makefile tweak to see MAXIMUM_MEMORY, but if you're using the npm then you're presumably not building your own.
I hope it’s just a tiny tweak. Unfortunately, attempts to increase the memory of other wasm libraries haven’t been so easy.
If the team considers distributing 64-bit builds in the future, I think that would be a good opportunity to look into increasing the MAXIMUM_MEMORY to support larger database files too.
The build already supports them and we recently spent about a week straightening out the breakage caused by the differing JS-side pointer types between the two1. We've discussed distributing 64-bit builds with the canonical downloads but it's a solution looking for a problem: we're not aware of anyone aching to make 64-bit-only browser-side deployments.
I hope it’s just a tiny tweak. Unfortunately, attempts to increase the memory of other wasm libraries haven’t been so easy.
It really is, but it's a build-time option, not runtime option. Search the makefile for emcc.jsflags and add yours to it. Some flags are set via generated code. The ones set in that makefile apply to all of the builds.
Then just make. See the README in that dir for the full build details.
Activity
sgbeal commentedon Nov 12, 2025
These bindings are not limited to 2gb dbs. Emscripten, however, caps the heap at 2gb, even in 64-bit builds. When using OPFS storage, you can store much more than 2GB (but doing so is ill-advised, as OPFS is, all marketing to the contrary, transient in nature, able to be wiped at the browser's whim).
Version 3.51 supports Emscripten 64-bit builds in all of its supported configurations. It DOES NOT support node (and will never do so without a generous long-term financial backer to cover the effort).
steida commentedon Nov 12, 2025
On both Chrome for Android and Safari for iOS (17+), installed PWAs are granted persistent or effectively persistent storage. Their OPFS data is not wiped automatically — unless the user deletes the app or the device runs critically low on space.
jlarmstrongiv commentedon Nov 13, 2025
It looks like maximum memory on emscripten can be changed using
MAXIMUM_MEMORYThat could allow for a heap larger than 2gb, and hopefully larger than 4gb in 64-bit builds.
sgbeal commentedon Nov 13, 2025
It could, i guess, but we don't distribute 64-bit builds and, after a team discussion, have no immediate plans to. You're welcome to build one with only a tiny makefile tweak to see MAXIMUM_MEMORY, but if you're using the npm then you're presumably not building your own.
Installed PWAs represent a diminishingly small subset of OPFS clients. For every other client, a browser update and/or hiccup can cause OPFS to be wiped.
jlarmstrongiv commentedon Nov 13, 2025
If the team considers distributing 64-bit builds in the future, I think that would be a good opportunity to look into increasing the MAXIMUM_MEMORY to support larger database files too.
It seems the maximum limit for the JS API is 16gb.
I think it’d be worth revisiting in the future when Safari adds support for Memory64.
I hope it’s just a tiny tweak. Unfortunately, attempts to increase the memory of other wasm libraries haven’t been so easy.
sgbeal commentedon Nov 13, 2025
The build already supports them and we recently spent about a week straightening out the breakage caused by the differing JS-side pointer types between the two1. We've discussed distributing 64-bit builds with the canonical downloads but it's a solution looking for a problem: we're not aware of anyone aching to make 64-bit-only browser-side deployments.
It really is, but it's a build-time option, not runtime option. Search the makefile for emcc.jsflags and add yours to it. Some flags are set via generated code. The ones set in that makefile apply to all of the builds.
Then just
make. See the README in that dir for the full build details.Footnotes
It's actually easier to write 32/64-bit-portable code in C than in JS because in JS the change breaks all pointer math: https://github.com/emscripten-core/emscripten/discussions/25341 ↩