Skip to content

What is total_allocations? #807

@peekxc

Description

@peekxc

What is total allocations?

For whatever reason, this only shows up in the JSON report (see #620).

Suppose I get an output like this:

{'total_num_allocations': 2844284,
 'total_bytes_allocated': 526180830,
 'allocation_size_histogram': [...],
 'allocator_type_distribution': {'PYMALLOC_MALLOC': 2721820,
  'PYMALLOC_REALLOC': 122350,
  'REALLOC': 86,
  'PYMALLOC_CALLOC': 22,
  'MALLOC': 6},
 'top_allocations_by_size': [...],
 'metadata': {
  'total_allocations': 5686611,
  'total_frames': 46,
  'peak_memory': 4073520,
  'python_allocator': 'pymalloc',
  'has_native_traces': False,
  'trace_python_allocators': True,
  'file_format': 0}}

Notice that total_num_allocations doesn't match total_allocations. It would be nice in memray included somewhere on its website a description of:

  • what total_num_allocations is
  • what total_allocations is
  • what total_frames is
  • what precisely peak_memory is

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions