Interface nsIMemoryReporterManagerType

Hierarchy

Properties

JSMainRuntimeCompartmentsSystem: int64_t
JSMainRuntimeCompartmentsUser: int64_t
JSMainRuntimeGCHeap: int64_t
JSMainRuntimeRealmsSystem: int64_t
JSMainRuntimeRealmsUser: int64_t
JSMainRuntimeTemporaryPeak: int64_t
ghostWindows: int64_t
hasMozMallocUsableSize: boolean

This attribute indicates if moz_malloc_usable_size() works.

heapAllocated: int64_t
heapOverheadFraction: int64_t
imagesContentUsedUncompressed: int64_t
isDMDEnabled: boolean

These attributes indicate DMD's status. "Enabled" means enabled at build-time.

isDMDRunning: boolean
lowMemoryEventsPhysical: int64_t
pageFaultsHard: int64_t
resident: int64_t
residentFast: int64_t
residentPeak: int64_t
residentUnique: int64_t
storageSQLite: int64_t
vsize: int64_t

The memory reporter manager, for the most part, treats reporters registered with it as a black box. However, there are some "distinguished" amounts (as could be reported by a memory reporter) that the manager provides as attributes, because they are sufficiently interesting that we want external code (e.g. telemetry) to be able to rely on them.

Note that these are not reporters and so getReports() does not look at them. However, distinguished amounts can be embedded in a reporter.

Access to these attributes can fail. In particular, some of them are not available on all platforms.

If you add a new distinguished amount, please update toolkit/components/aboutmemory/tests/test_memoryReporters.xul.

|vsize| (UNITS_BYTES) The virtual size, i.e. the amount of address space taken up.

|vsizeMaxContiguous| (UNITS_BYTES) The size of the largest contiguous block of virtual memory.

|resident| (UNITS_BYTES) The resident size (a.k.a. RSS or physical memory used).

|residentFast| (UNITS_BYTES) This is like |resident|, but on Mac OS |resident| can purge pages, which is slow. It also affects the result of |residentFast|, and so |resident| and |residentFast| should not be used together.

|residentPeak| (UNITS_BYTES) The peak resident size.

|residentUnique| (UNITS_BYTES) The unique set size (a.k.a. USS).

|heapAllocated| (UNITS_BYTES) Memory mapped by the heap allocator.

|heapOverheadFraction| (UNITS_PERCENTAGE) In the heap allocator, this is the fraction of committed heap bytes that are overhead. Like all UNITS_PERCENTAGE measurements, its amount is multiplied by 100x so it can be represented by an int64_t.

|JSMainRuntimeGCHeap| (UNITS_BYTES) Size of the main JS runtime's GC heap.

|JSMainRuntimeTemporaryPeak| (UNITS_BYTES) Peak size of the transient storage in the main JSRuntime.

|JSMainRuntimeCompartments{System,User}| (UNITS_COUNT) The number of {system,user} compartments in the main JS runtime.

|JSMainRuntimeRealms{System,User}| (UNITS_COUNT) The number of {system,user} realms in the main JS runtime.

|imagesContentUsedUncompressed| (UNITS_BYTES) Memory used for decoded raster images in content.

|storageSQLite| (UNITS_BYTES) Memory used by SQLite.

|lowMemoryEventsPhysical| (UNITS_COUNT_CUMULATIVE) The number of low-physical-memory events that have occurred since the process started.

|ghostWindows| (UNITS_COUNT) A cached value of the number of ghost windows. This should have been updated within the past 60s.

|pageFaultsHard| (UNITS_COUNT_CUMULATIVE) The number of hard (a.k.a. major) page faults that have occurred since the process started.

vsizeMaxContiguous: int64_t

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • These functions should only be used for testing purposes.

    Returns void

  • Called by an asynchronous memory reporter upon completion.

    Returns void

  • Get memory reports for the current process and all child processes. |handleReport| is called for each report, and |finishReporting| is called once all reports have been handled.

    |finishReporting| is called even if, for example, some child processes fail to report back. However, calls to this method will silently and immediately abort -- and |finishReporting| will not be called -- if a previous getReports() call is still in flight, i.e. if it has not yet finished invoking |finishReporting|. The silent abort is because the in-flight request will finish soon, and the caller would very likely just catch and ignore any error anyway.

    If |anonymize| is true, it indicates that the memory reporters should anonymize any privacy-sensitive data (see above).

    Parameters

    • handleReport: nsIHandleReportCallback
    • handleReportData: nsISupports
    • finishReporting: nsIFinishReportingCallback
    • finishReportingData: nsISupports
    • anonymize: boolean

    Returns void

  • As above, but: If |minimizeMemoryUsage| is true, then each process will minimize its memory usage (see the |minimizeMemoryUsage| method) before gathering its report. If DMD is enabled and |DMDDumpIdent| is non-empty then write a DMD report to a file in the usual temporary directory (see |dumpMemoryInfoToTempDir| in |nsIMemoryInfoDumper|.)

    Parameters

    • handleReport: nsIHandleReportCallback
    • handleReportData: nsISupports
    • finishReporting: nsIFinishReportingCallback
    • finishReportingData: nsISupports
    • anonymize: boolean
    • minimizeMemoryUsage: boolean
    • DMDDumpIdent: string

    Returns void

  • As above, but if DMD is enabled and |DMDFile| is non-null then write a DMD report to that file and close it.

    Parameters

    • handleReport: nsIHandleReportCallback
    • handleReportData: nsISupports
    • anonymize: boolean
    • DMDFile: FILE
    • finishReporting: nsIFinishReportingCallback
    • finishReportingData: nsISupports

    Returns void

  • Initialize.

    Returns void

  • Run a series of GC/CC's in an attempt to minimize the application's memory usage. When we're finished doing this for the current process, we invoke the given runnable if it's not null. We do not wait for any child processes that might be doing their own minimization via child-mmu-request to finish.

    Parameters

    • callback: nsIRunnable

    Returns void

  • Parameters

    • reporter: nsIMemoryReporter

    Returns void

  • Register the given nsIMemoryReporter. The Manager service will hold a strong reference to the given reporter, and will be responsible for freeing the reporter at shutdown. You may manually unregister the reporter with unregisterStrongReporter() at any point.

    Parameters

    • reporter: nsIMemoryReporter

    Returns void

  • Parameters

    • aReporter: nsIMemoryReporter

    Returns void

  • Parameters

    • reporter: nsIMemoryReporter

    Returns void

  • Like registerReporter, but the Manager service will hold a weak reference via a raw pointer to the given reporter. The reporter should be unregistered before shutdown. You cannot register JavaScript components with this function! Always register your JavaScript components with registerStrongReporter().

    Parameters

    • reporter: nsIMemoryReporter

    Returns void

  • Measure the memory that is known to be owned by this tab, split up into several broad categories. Note that this will be an underestimate of the true number, due to imperfect memory reporter coverage (corresponding to about:memory's "heap-unclassified"), and due to some memory shared between tabs not being counted.

    The time taken for the measurement (split into JS and non-JS parts) is also returned.

    Parameters

    • window: mozIDOMWindowProxy
    • jsObjectsSize: int64_t
    • jsStringsSize: int64_t
    • jsOtherSize: int64_t
    • domSize: int64_t
    • styleSize: int64_t
    • otherSize: int64_t
    • totalSize: int64_t
    • jsMilliseconds: number
    • nonJSMilliseconds: number

    Returns void

  • Returns void

  • Unregister the given memory reporter, which must have been registered with registerStrongReporter(). You normally don't need to unregister your strong reporters, as nsIMemoryReporterManager will take care of that at shutdown.

    Parameters

    • reporter: nsIMemoryReporter

    Returns void

  • Unregister the given memory reporter, which must have been registered with registerWeakReporter().

    Parameters

    • reporter: nsIMemoryReporter

    Returns void

Generated using TypeDoc