On Tue, Dec 17, 2013 at 6:54 PM, Ehsan Akhgari <ehsan.akhg...@gmail.com> wrote: > > How does one write a memory reporter that captures data stored on more than > just the main thread? In the case of Web Audio for example, some of our > buffers live in another thread, and as far as I can see the memory reporter > API is mostly synchronous. Is locking the right way to do this?
Good question. It depends on the details. Each memory reporter's CollectReports() method is called only from the main thread, and the CollectReports() call is synchronous. There isn't a good way to do asynchronous reporting. Web workers use a hack: code running on the main thread completely pauses (via locks) each worker's actions and then the main thread code measures the worker's data structures. So you may need to do something similar. One thing that's possibly in your favour is that memory reporting isn't performance-critical, since it only happens in response to user requests. Nick _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform