> Do you want to find our what constructs in your source are generating 30099056 bytes of static data?
Yes basically it's my question.
I dig more, and now it seems even more strange for me. Compiler ask me
to set TOTAL_MEMORY min to ~30Mb. I used bloaty/twiggy(thanks, great
tool!) to show data secion of generated wasm:
bloaty:
VM SIZE FILE SIZE
-------------- --------------
NAN% 0 Code 1.76Mi 86.7%
NAN% 0 Data 266Ki 12.8%
NAN% 0 Element 4.84Ki 0.2%
NAN% 0 Function 3.63Ki 0.2%
NAN% 0 Import 1.08Ki 0.1%
NAN% 0 Type 446 0.0%
NAN% 0 Export 172 0.0%
NAN% 0 Global 21 0.0%
NAN% 0 [WASM Header] 8 0.0%
100.0% 0 TOTAL 2.03Mi 100.0%
So data is ~266Kb
Next I switched to emmaloc, to find firstRegion location(firstRegion
is begining of heap in emmalloc). It's possible to find it with
this hack: printf("firstRegion: %d\n", (size_t) sbrk(0) - mallinfo().arena);
firstRegion: 36476272
So heap started at ~34Mb, how I can understand which data is placed in
0..34Mb section?
> You can also inspect you object files with wasm-objdump or try
passing `-Wl,--verbose` at link time and the linker reports some data
layout information.
-Wl,--verbose on link step ended with warning that --verbose is unknown flag.
ср, 3 июл. 2019 г. в 23:56, 'Sam Clegg' via emscripten-discuss
<
emscripte...@googlegroups.com>:
> To view this discussion on the web visit
https://groups.google.com/d/msgid/emscripten-discuss/CAL_va2_Tp9wVL0%3D8ei6Ena9byg7%3Dpi_%3DVMsPkF_kTm6oiChkSA%40mail.gmail.com.