Emscripten Memory Usage

279 views
Skip to first unread message

a4aks...@gmail.com

unread,
Jun 8, 2017, 9:59:26 AM6/8/17
to emscripten-discuss


I am trying to port a game which uses Scaleform VM to Emscripten. 


Currently on OS X, running on XCode with only scaleform shows about 41MB usage (Reported by scaleform profiler)

After converting to JS using emscripten,it shows about 600MB-1GB on Activity Monitor. I built emscripten with a memory limit of 64MB and the same amount of memory (64MB) is shown by the emscripten memory profiler.


There is a huge difference in the memory as shown by the activity monitor as compared to the allocated memory reported by emscripten. 


Any pointers on why this might be happening or where to start looking at this issue?



Brion Vibber

unread,
Jun 8, 2017, 4:53:34 PM6/8/17
to emscripten Mailing List
On Thu, Jun 8, 2017 at 6:59 AM, <a4aks...@gmail.com> wrote:

I am trying to port a game which uses Scaleform VM to Emscripten. 


Currently on OS X, running on XCode with only scaleform shows about 41MB usage (Reported by scaleform profiler)

After converting to JS using emscripten,it shows about 600MB-1GB on Activity Monitor. I built emscripten with a memory limit of 64MB and the same amount of memory (64MB) is shown by the emscripten memory profiler.


There is a huge difference in the memory as shown by the activity monitor as compared to the allocated memory reported by emscripten. 


The emscripten memory buffer is a fixed-size buffer that your program's *data* goes into; Activity Monitor is reporting the total memory usage of *Firefox as a whole*.

Think of the browser as an operating system; in addition the core of the browser, it has to hold in memory everything from your browser tab *and* any other browser tabs; it has to load and compile all your code (which is separate from your 64 MB data heap), composite the graphics output, etc.

Check out <about:memory> in Firefox for more detailed breakdowns of how memory is being used in the browser and where it comes from.

-- brion
Reply all
Reply to author
Forward
0 new messages