On this page

C

HeapProfileHandle

History
M

heapProfileHandle.getSamples

History
heapProfileHandle.getSamples(): Promise
Returns:Promise
Fulfills with an Object[] of allocation samples.

Asynchronously retrieves the worker's retained allocation samples without stopping profiling or building the full profile call tree. The sample fields and profiling options are described in syncHeapProfileHandle.getSamples().

Rejects with ERR_HEAP_PROFILE_NOT_STARTED if this handle has been stopped or disposed, or ERR_WORKER_NOT_RUNNING if the worker is no longer running.

M

heapProfileHandle.setSampleInterval

History
heapProfileHandle.setSampleInterval(sampleInterval): Promise
Attributes
sampleInterval:integer
Average sampling interval in bytes. Must be between 1 and Number.MAX_SAFE_INTEGER, inclusive.
Returns:Promise
Fulfills with undefined after the interval is updated.

Asynchronously updates the worker's sampling interval for future sample scheduling without restarting profiling or discarding existing samples. Each sample retains the sampleInterval used when it was selected.

Invalid arguments throw synchronously. The returned promise rejects with ERR_HEAP_PROFILE_NOT_STARTED if this handle has been stopped or disposed, or ERR_WORKER_NOT_RUNNING if the worker is no longer running.

M

heapProfileHandle.stop

History
heapProfileHandle.stop(): Promise
Returns:Promise

Stopping collecting the profile, then return a Promise that fulfills with an error or the profile data.

M

heapProfileHandle[Symbol.asyncDispose]

History
heapProfileHandle[Symbol.asyncDispose](): Promise
Returns:Promise

Stopping collecting the profile and the profile will be discarded.