Using the LLVM wasm backend, emscripten will by default use wasm object
files - so it doesn't compile all the bitcode at the link step, and should
use a lot less memory. On linux you can get it using the emsdk with
latest-upstream (more builds coming soon), or you can build it manually
from source.

You may also be able to reduce some memory usage with the EMCC_CORES and
BINARYEN_CORES environment variables, as they tell parts of the
compiler/optimizer how many cores to use (but then compilation might take
longer).

On Mon, May 6, 2019 at 4:22 AM [email protected] <[email protected]>
wrote:

> Hey,
>
> I'm really impressed with imscripten, it's such a cool project.
>
> I was wondering if anyone had any tips for reducing the memory usage when
> building with emcc.
>
> I have a c++ project that was originally written to run natively, but
> ports nicely to wasm and webgl. It's really cool to see it running in a web
> browser. But I've noticed that emcc aquires about ~3gb of memory during the
> final linking stage. I get that it's doing link time optimisation and that
> all my object files are essentially still code (llvm bytecode), so I can
> maybe understand why it needs this much memory, but I was wondering if
> anyone has advice on how I can get this down ? so that I could build my
> project on a less powerful (and therefore cheaper) build server.
>
> Really appreciate any insites you guys have about this.
>
> Thanks in advance.
> Luke
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to