seikichi / tiff.js

tiff.js is a port of LibTIFF by compiling the LibTIFF C code with Emscripten.
Other
387 stars 98 forks source link

Cannot enlarge memory arrays in asm.js #7

Open rajatcse1 opened 9 years ago

rajatcse1 commented 9 years ago

I was trying to load 100 images with dimension 1700 px X 2100 px in parallel, got this issue:

Error Message:” Cannot enlarge memory arrays in asm.js. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 167772160, or (2) set Module.TOTAL_MEMORY before the program runs.”

browser: Firefox 34

Please guide us.

marknuzz commented 8 years ago

If you are unable to increase the TOTAL_MEMORY past a predetermined limit, then Your best bet would be to try to recompile the library using build.sh, with some custom C code to allow reformatting the TIFF images into a compressed format. Then in your JS code you would monitor the memory usage and clean up your uncompressed image state before continuing. The browser can only handle so much and therefore pushing the limits of it is going to require a bit extra.