From:  Kan-Ru Chen (陳侃如) <>
Date:  17 Nov 2015 12:15:44 Hong Kong Time

New memory profiling tool available



This is an on going project that recently moved into a usable state. The
objective is to let developers profile their website or apps to analyze
their memory allocation characteristics. For example it could be used to
find memory allocation hot spots that might give memory pressure to
other apps on the system.

The profiler is designed at the very beginning to support not only
JavaScript but also native codes. Naturally, not only JavaScript objects
but also native allocations are tracked.

It samples memory allocation based on accumulated allocation sizes so it
could detect both rapid allocations and large allocations. Each
allocation sampled has size and stack trace recorded so these sampled
events can be used to approximate the full history of allocations
afterwards. It also impose very low overhead on the system being

Currently the gecko support has been landed on mozilla-central and
enabled by default. The ability to sample native allocations is enabled
when replace-malloc is enabled, which is default on Nightly.

The user interface is developed as an devtools add-on. Once installed it
could be accessed from developer toolbar or WebIDE.
Here are instructions for installing and using the Memory Profiler add-on:

We also plan to work on a command line interface for scripting and
custom post-processing.

Here is the project page if you are interested and want to contribute:

Please try it out and file bugs in the "Core" product and "Gecko
Profiler" component! We want this to be a useful tool for _you_!