CDPotion.Domain.HeapProfiler (cdpotion v0.1.4)

Summary

Types

Heap snapshot object id.

Sampling profile.

Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.

A single sample from a sampling profile.

Functions

Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).

Parameters:

  • (Required) object_id: Identifier of the object to get heap object id for.

Parameters:

  • (Required) object_id: description not provided :(
  • (Optional) object_group: Symbolic group name that can be used to release multiple objects.

Parameters:

  • (Optional) sampling_interval: Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.
  • (Optional) include_objects_collected_by_major_gc: By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by major GC, which will show which functions cause large temporary memory usage or long GC pauses.
  • (Optional) include_objects_collected_by_minor_gc: By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by minor GC, which is useful when tuning a latency-sensitive application for minimal GC activity.

Parameters:

  • (Optional) track_allocations: description not provided :(

Parameters:

  • (Optional) report_progress: If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
  • (Optional) treat_global_objects_as_roots: Deprecated in favor of exposeInternals.
  • (Optional) capture_numeric_value: If true, numerical values are included in the snapshot
  • (Optional) expose_internals: If true, exposes internals of the snapshot.

Parameters:

  • (Optional) report_progress: If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
  • (Optional) treat_global_objects_as_roots: If true, a raw snapshot without artificial roots will be generated. Deprecated in favor of exposeInternals.
  • (Optional) capture_numeric_value: If true, numerical values are included in the snapshot
  • (Optional) expose_internals: If true, exposes internals of the snapshot.

Types

Link to this type

heap_snapshot_object_id()

@type heap_snapshot_object_id() :: String.t()

Heap snapshot object id.

Link to this type

sampling_heap_profile()

@type sampling_heap_profile() :: %{
  head: sampling_heap_profile_node(),
  samples: [sampling_heap_profile_sample()]
}

Sampling profile.

Link to this type

sampling_heap_profile_node()

@type sampling_heap_profile_node() :: %{
  callFrame: CDPotion.Domain.Runtime.call_frame(),
  children: [sampling_heap_profile_node()],
  id: integer(),
  selfSize: number()
}

Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.

Link to this type

sampling_heap_profile_sample()

@type sampling_heap_profile_sample() :: %{
  nodeId: integer(),
  ordinal: number(),
  size: number()
}

A single sample from a sampling profile.

Functions

Link to this function

add_inspected_heap_object(heap_object_id)

@spec add_inspected_heap_object(heap_snapshot_object_id()) :: {String.t(), map()}

Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).

Parameters:

  • (Required) heap_object_id: Heap snapshot object id to be accessible by means of $x command line API.
Link to this function

collect_garbage()

@spec collect_garbage() :: {String.t(), map()}
@spec disable() :: {String.t(), map()}
@spec enable() :: {String.t(), map()}
Link to this function

get_heap_object_id(object_id)

@spec get_heap_object_id(CDPotion.Domain.Runtime.remote_object_id()) ::
  {String.t(), map()}

Parameters:

  • (Required) object_id: Identifier of the object to get heap object id for.
Link to this function

get_object_by_heap_object_id(object_id, object_group \\ nil)

@spec get_object_by_heap_object_id(
  heap_snapshot_object_id(),
  String.t()
) :: {String.t(), map()}

Parameters:

  • (Required) object_id: description not provided :(
  • (Optional) object_group: Symbolic group name that can be used to release multiple objects.
Link to this function

get_sampling_profile()

@spec get_sampling_profile() :: {String.t(), map()}
Link to this function

start_sampling(sampling_interval \\ nil, include_objects_collected_by_major_gc \\ nil, include_objects_collected_by_minor_gc \\ nil)

@spec start_sampling(number(), boolean(), boolean()) :: {String.t(), map()}

Parameters:

  • (Optional) sampling_interval: Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.
  • (Optional) include_objects_collected_by_major_gc: By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by major GC, which will show which functions cause large temporary memory usage or long GC pauses.
  • (Optional) include_objects_collected_by_minor_gc: By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by minor GC, which is useful when tuning a latency-sensitive application for minimal GC activity.
Link to this function

start_tracking_heap_objects(track_allocations \\ nil)

@spec start_tracking_heap_objects(boolean()) :: {String.t(), map()}

Parameters:

  • (Optional) track_allocations: description not provided :(
Link to this function

stop_sampling()

@spec stop_sampling() :: {String.t(), map()}
Link to this function

stop_tracking_heap_objects(report_progress \\ nil, treat_global_objects_as_roots \\ nil, capture_numeric_value \\ nil, expose_internals \\ nil)

@spec stop_tracking_heap_objects(boolean(), boolean(), boolean(), boolean()) ::
  {String.t(), map()}

Parameters:

  • (Optional) report_progress: If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
  • (Optional) treat_global_objects_as_roots: Deprecated in favor of exposeInternals.
  • (Optional) capture_numeric_value: If true, numerical values are included in the snapshot
  • (Optional) expose_internals: If true, exposes internals of the snapshot.
Link to this function

take_heap_snapshot(report_progress \\ nil, treat_global_objects_as_roots \\ nil, capture_numeric_value \\ nil, expose_internals \\ nil)

@spec take_heap_snapshot(boolean(), boolean(), boolean(), boolean()) ::
  {String.t(), map()}

Parameters:

  • (Optional) report_progress: If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
  • (Optional) treat_global_objects_as_roots: If true, a raw snapshot without artificial roots will be generated. Deprecated in favor of exposeInternals.
  • (Optional) capture_numeric_value: If true, numerical values are included in the snapshot
  • (Optional) expose_internals: If true, exposes internals of the snapshot.