Hi guys,

I'm trying to investigate a leak in our engine and was wondering why the 
memory limit would behave differently on mobile and desktop browsers. All 
mobile browsers crash with a TOTAL_MEMORY exception while desktop browsers 
don't. I'm especially trying to fix this on iPad, but that's also the case 
on Android.

I thought I understood asm.js and made the following assumptions:

   1. Before starting the program, Emscripten with asm.js will allocate a 
   big array to simulate the RAM.
   2. The size of the memory array depends on TOTAL_MEMORY.
   3. Besides browser-specific optimizations, the allocated / used memory 
   by a program is deterministic.
   4. If TOTAL_MEMORY is too big for the actual device, the browser will 
   immediately crash.

What I'm experiencing clearly shows that I'm wrong about assumptions #3 and 
#4, so here's a few questions:

   - Do browsers perform some "virtual memory" allocation of the asm.js 
   array? Some trick that would make a 256 MB array not crash in Safari Mobile 
   until being actually filled with data.
   - What would be a safe TOTAL_MEMORY value for mobile browsers?
   - What's the best technique for memory profiling in JavaScript when 
   using asm.js? Can --profiling help profiling memory if the memory array 
   is preallocated?
   - What's the role of the memory initialization file? What does it 
   contain on startup?


Thanks a lot,
Warren.

-- 
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