Emscripten trace.h

Hi All,

Emscripten has trace.h that can profile memory usage of HEAP.
https://kripken.github.io/emscripten-site/docs/api_reference/trace.h.html?highlight=memory

Can we enable trace.h in our WebGL builds?
(we must add –tracing flag to emcc)

not at the moment. We would need to implement this feature in native code and build pipeline.

Are you interested in profiling the Unity Heap ? If so, you can just use the Unity Profiler.

I want to profile HEAP used in my WebGL build(reserved by Javascript code)
I cant see any information about that heap in Unity Profiler.

The memory profiler in Unity (Unity - Manual: Memory Profiler module) will show you the contents of the heap reserved by JS code when profiling WebGL contents.

Thx.
I really try to use profiler - but on every WebGL project after 3-5 seconds of recording browser hangs out. In unity I get “Sending message header failed” warning.

I see that you are checking DYNAMICTOP < TOTAL_MEMORY before showing MemotyOut error.
If I understand you correct I can view emscripten HEAP by doing memory snapshot from Profiler?

Also Development Build takes to much memory…