Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note about limited memory allocation by wasm for webR in browsers on mobile devices #346

Open
SugarRayLua opened this issue Dec 31, 2023 · 0 comments

Comments

@SugarRayLua
Copy link

SugarRayLua commented Dec 31, 2023

When I first started using webR when it came out, I had noticed that I couldn't analyze as large datasets while using webR on my mobile device (iPad) as compared to when I accessed webR on my desktop (Mac). I didn't think much about this for over a year until I recently started working on a mobile project that queries an API and uses webR as a dependency. I was attempting to download an .xml file and needed an xml parser; initially, I tried using the xmlconvert package but kept getting an out of memory error in R when trying to convert xml_to_df (yet worked find trying to convert the same .xml file to df on webR running on my Mac; I was able to instead use the xml2 package which I presume uses less memory). I thus did some further research and learned from this Unity forum post that some browsers have not kept up with wasm and have not allowed wasm to allocate more than 500MB of memory for wasm projects running in their browsers:

https://forum.unity.com/threads/android-chromium-unable-to-grow-allocated-memory-above-256mb-confirmed.1014475/

That forum discussion also included a test link to estimate how much memory can be allocated to wasm projects in specific browser/device combinations:

http://clb.confined.space/dump/mem_growth.html

Interestingly, when using the above test link on my 8GB iPad Pro, my iPad browsers only allocate 250-500MB max. My Mac allocated 1GB.

When my colleague tried the above test site on his Android devices, he was only able to allocate 500MB using Google but could allocate 2GB using Firefox on his Android phone.(Unfortunately, Firefox on Apple mobile devices doesn't actually use Firefox's Gecko engine [Webkit instead])

Wanted to alert the webR community of this current memory limitation when using webR with certain browsers on certain mobile devices. (Fyi)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant