nsIMemoryReporterManager 编辑

xpcom/base/nsIMemoryReporter.idlScriptable A service that provides methods for managing nsIMemoryReporter objects. Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3)

Implemented by @mozilla.org/memory-reporter-manager;1 as a service:

var reporterManager = Components.classes["@mozilla.org/memory-reporter-manager;1"]
                      .getService(Components.interfaces.nsIMemoryReporterManager);

Each memory reporter object, which implements nsiMemoryReporter interface, provides information for a given code area. Each code area is identified by a unique path string, which is displayed in about:memory.

Method overview

nsISimpleEnumerator enumerateMultiReporters();
nsISimpleEnumerator enumerateReporters();
void init();
void registerMultiReporter(in nsIMemoryMultiReporter reporter);
void registerReporter(in nsIMemoryReporter reporter);
void unregisterMultiReporter(in nsIMemoryMultiReporter reporter);
void unregisterReporter(in nsIMemoryReporter reporter);

Attributes

AttributeTypeDescription
explicitPRInt64

Gets the total size of explicit memory allocations, both at the operating system level (for example, via mmap, VirtualAlloc) and at the heap level (for example, via malloc(), calloc(), operator new).

Note: It covers all heap allocations, but will miss any Operating System level ones not covered by memory reporters. This reporter is special-cased because it is interesting, and is moderately difficult to compute in JavaScript. -1 means unknown. Read only.
residentPRInt64

Gets the resident size (that is RSS, physical memory used).

This reporter is special-cased because it is interesting, is available on all platforms, and returns a meaningful result on all common platforms. -1 means unknown. Read only.

Methods

enumerateMultiReporters()

Returns an enumerator for looking at the installed memory multi-reporters.

nsISimpleEnumerator enumerateMultiReporters();
Parameters

None.

Return value

An enumerator of nsIMemoryMultiReporters that are currently registered.

enumerateReporters()

Returns an enumerator for looking at the installed memory reporters.

nsISimpleEnumerator enumerateReporters();
Parameters

None.

Return value

An nsISimpleEnumerator for enumerating installed memory reporters.

init()

Initializes the memory reporter manager.

void init();
Parameters

None.

registerMultiReporter()

Requests that memory multi-reporter notifications be sent to the specified objects.

void registerMultiReporter(
  in nsIMemoryMultiReporter reporter
);
Parameters
reporter
An object implementing the nsIMemoryMultiReporter interface which provides memory usage information for a given code area.

registerReporter()

Requests that memory reporter notifications be sent to the specified objects.

void registerReporter(
  in nsIMemoryReporter reporter
);
Parameters
reporter
An object implementing the nsIMemoryReporter interface which provides memory usage information for a given code area.

unregisterMultiReporter()

Stops sending memory multi-reporter notifications to the specified object.

void unregisterMultiReporter(
  in nsIMemoryMultiReporter reporter
);
Parameters
reporter
An object implementing the nsIMemoryMultiReporter interface which provides memory usage information for a given code area.

unregisterReporter()

Stops sending memory reporter notifications to the specified object.

void unregisterReporter(
  in nsIMemoryReporter reporter
);
Parameters
reporter
An object implementing the nsIMemoryReporter interface which provides memory usage information for a given code area.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:50 次

字数:8402

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文