Nothing special. Just switch to -Oz flag, and drop some 3rd party libraries. Tools like bloaty is very usefull. In my case I need too decrese wasm size on really small amount. Anyway I hope that 12+ will solve this problem forever.
пн, 11 мар. 2019 г. в 21:54, Alex St. Louis <[email protected]>: > > Curious, how did you find a way to reduce your wasm size? We're bringing > games to the web, and any way we can optimize the file sizes would make all > the difference. > > On Mon, Mar 11, 2019 at 12:56 AM Александр Гурьянов <[email protected]> > wrote: >> >> No, I found way to reduce wasm size, and it works for me. >> >> пн, 11 мар. 2019 г. в 12:13, Wanghb Wang <[email protected]>: >> > >> > Did you test your App on safari(12+)? >> > >> > 在 2019年3月8日星期五 UTC+8下午1:53:45,caiiiycuk写道: >> >> >> >> Hi. Only reducing wasm size helps for me. From my experience if wasm size >> >> is bigger then 3mb (gzipped) you can catch this error. Also somewhere I >> >> read that its bug of safari, and it should be fixed starting from12 >> >> version >> >> пт, 8 мар. 2019 г., 10:10 Wanghb Wang <[email protected]>: >> >>> >> >>> hi caiiiycuk >> >>> I have the same question with iphone/ipad >> >>> Do you fix the question? >> >>> 在 2018年7月31日星期二 UTC+8下午9:03:19,caiiiycuk写道: >> >>>> >> >>>> After playing a lot with memory, I almost sure that problem is not >> >>>> related to TOTAL_MEMORY. Even with 16Mb I have this bug sometimes. I >> >>>> believe that it is related to >> >>>> https://github.com/kripken/emscripten/issues/6042. From time to time >> >>>> I've have this error: >> >>>> 12381ms | exception thrown: Error: Out of bounds memory access >> >>>> (evaluating 'Module["asm"]["_main"].apply(null, >> >>>> arguments)'),<?>.wasm-function[__ZN4game18Scene_SplashScreen4initEv]@[wasm >> >>>> code] >> >>>> <?>.wasm-function[__ZN4game18Scene_SplashScreen6createEv]@[wasm code] >> >>>> <?>.wasm-function[__ZN4game5CMain4initEv]@[wasm code] >> >>>> <?>.wasm-function[__ZN4game11AppDelegate29applicationDidFinishLaunchingEv]@[wasm >> >>>> code] >> >>>> <?>.wasm-function[__ZN7cocos2d11Application3runEv]@[wasm code] >> >>>> <?>.wasm-function[_main]@[wasm code] >> >>>> wasm-stub@[wasm code] >> >>>> _main@[native code] >> >>>> >> >>>> callMain >> >>>> http://192.168.1.37/gamepix-loader.js:456:30 >> >>>> fn@http://192.168.1.37/gamepix-loader.js:465:32 >> >>>> >> >>>> This happens only on ios, and only on mobile. Asm.js works fine. >> >>>> I think to add ios into blacklist for wasm, because this bug is >> >>>> completely random. Test from Brion >> >>>> (https://github.com/brion/min-wasm-fail/blob/master/min-wasm-fail.js) >> >>>> always succeed. >> >>>> вт, 31 июл. 2018 г. в 3:57, Alon Zakai <[email protected]>: >> >>>> > >> >>>> > How big is TOTAL_MEMORY in this project? It could be either the >> >>>> > binary size itself, or the memory size, that it doesn't have enough >> >>>> > memory for. >> >>>> > >> >>>> > On Mon, Jul 30, 2018 at 10:22 AM, Александр Гурьянов >> >>>> > <[email protected]> wrote: >> >>>> >> >> >>>> >> failed to asynchronously prepare wasm: Error: Out of executable >> >>>> >> memory >> >>>> >> in function at index 11802 >> >>>> >> [native code]:1 Unhandled Promise Rejection: Error: Out of executable >> >>>> >> memory in function at index 11802(anonymous function) @ [native >> >>>> >> code]:1promiseReactionJob @ [native code]:1 >> >>>> >> пн, 30 июл. 2018 г. в 13:07, Александр Гурьянов <[email protected]>: >> >>>> >> > >> >>>> >> > Hi guys. I faced this problem "failed to asynchronously prepare >> >>>> >> > wasm: >> >>>> >> > Error: Out of executable memory" with one of my project. >> >>>> >> > >> >>>> >> > wasm binary size is 5.1 Mb >> >>>> >> > >> >>>> >> > This error present on iphone 8, both in Chrome and Safari. This >> >>>> >> > error >> >>>> >> > is not stable, it is happen ~one time in five runs. And I just >> >>>> >> > reload >> >>>> >> > the page and game start working. >> >>>> >> > >> >>>> >> > This error occurs before 'onRutimeInitialized' is called. I use >> >>>> >> > ArrayBuffer as wasmBinary, because I can't change mime type to >> >>>> >> > application/wasm on my backend. >> >>>> >> > >> >>>> >> > Asm.js version works fine. >> >>>> >> > >> >>>> >> > I will try to reduce size of wasm binary, but it does not looks >> >>>> >> > very >> >>>> >> > big for me. Any ideas? >> >>>> >> > >> >>>> >> > Thanks. >> >>>> >> >> >>>> >> -- >> >>>> >> 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. >> >>> >> >>> -- >> >>> 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. >> >> -- >> 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. -- 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.
