Hi,
I'm trying to track down an issue we're having with a system which uses libtiff
(compiled with emscripten) to load tiff files into memory for processing. It's
been working great, but recently we have been trying to use larger files and
started running into memory issues.
Things are working reasonably well on Chrome, but on FireFox we're having a
strange issue. I'm running the emscripten code in a web worker, and it
initially works but on this one particular file I get the following error
message:
--
InternalError: uncaught exception: abort("Cannot enlarge memory arrays. Either
(1) compile with -s TOTAL_MEMORY=X with X higher than the current value
16777216, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at
runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before
the program runs.")
--
This error seems at first glance to be pretty self explanatory; however, there
are a couple of oddities here. First is that ALLOW_MEMORY_GROWTH is in fact
set to 1 in my build step. I can see in the generated code that the function
"enlargeMemory" has an implementation, whereas if I remove that option and
rebuild it just throws an exception, so I know it's being seen by the compiler.
Second, I have specified a larger TOTAL_MEMORY in the compilation step --
though the value in the error message, which the code shows as coming from
Module.TOTAL_MEMORY, is 16777216, the value I passed in when I compiled was
134217728. I even found this line in the code:
var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||134217728;
That value changes when I change the values passed into the compilation, so I
presume that it is actually working correctly there. I've also tried using a
JS wrapper to set the memory in javascript before loading:
Module = {TOTAL_MEMORY: 1024 * 1024 * 64};
This seems to have no effect whatsoever.
What it almost seems like is that firefox is imposing a memory limit -- this
works fine on Chrome, after all -- but I don't know why that would be or how to
affect it if so.
Any ideas?
Here are my compile flags:
"-O2 -ftree-vectorize -Werror -s ASSERTIONS=2 --memory-init-file \"0\" -s
TOTAL_MEMORY=134217728 -s ALLOW_MEMORY_GROWTH=1 -s
EXPORTED_FUNCTIONS=\"['_createTiff','_next', '_width', '_height', '_getData',
'_getCount', '_freeTiff', '_getVersion', '_tmalloc', '_tfree', 'FS']\""
I'm kinda running out of ideas here =] Any help would be appreciated.
Richard
--
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.