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

Available memory size is fixed (enlarge it? grow dynamically?) #32

Open
gchiu opened this issue Mar 21, 2019 · 4 comments
Open

Available memory size is fixed (enlarge it? grow dynamically?) #32

gchiu opened this issue Mar 21, 2019 · 4 comments

Comments

@gchiu
Copy link
Collaborator

gchiu commented Mar 21, 2019

I enabled CORS policy on the metaeducation S3 buckets

read http://metaeducation.s3.amazonaws.com/travis-builds/0.3.40/r3-3ffb63e-debug.exe

then fails with

Cannot enlarge memory arrays to size 23977984 bytes (OOM). Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0

@hostilefork hostilefork changed the title can't enlarge memory arrays where reading files Available memory size is fixed (enlarge it? grow dynamically?) Apr 23, 2019
@hostilefork
Copy link
Owner

Emscripten's ALLOW_MEMORY_GROWTH option does not currently work with pthreads:

emscripten-core/emscripten#7382

Looks like it's a V8 limitation, so the question is when they're going to get it.

So long as we're stuck with a fixed size, I don't know what we should be picking...we're just taking whatever the default is right now.

@hostilefork
Copy link
Owner

It looks like one can set this at runtime, maybe:

emscripten-core/emscripten#5493

So it could be an option to reb.Startup()?

@BrianOtto
Copy link
Collaborator

I append a hack that sets a larger memory size in the Emscripten config when building libr3 for UI Builder. It currently needs 75497472 bytes when exporting apps. It would be nice if I could get rid of this and specify an option to reb.Startup() instead.

@hostilefork
Copy link
Owner

hostilefork commented May 9, 2019

Looks like growable memory for pthreads is coming to the SDK shortly, was added last month on GitHub:

emscripten-core/emscripten#8365

Causes some slowdown, because any thread can grow the heap, and this can catch the other threads by surprise. Once it comes along we'll have to see how much that affects our usual operation.

Chrome doesn't support the underlying feature just yet, but Firefox does. Anyway, things are on track for this to be an option...but we still should probably have a reb.Startup() option...if we can.

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

3 participants