Skip to content

MemoryStats

Inspect a line's memory field for Python allocation measurements in bytes. Process RAM is recorded separately in ProcessMemoryStats.

dataclass linescope.model.MemoryStats[source]

Describe allocation measurements in bytes, separate from process RAM.

The shared collector measures net retained Python allocations by allocation site. It leaves allocation peaks unavailable; process RSS belongs to ProcessMemoryStats. Custom collectors can supply their own allocation measurements, keeping missing values unknown.

Attributes

delta_bytes : int | None

Signed allocation change in bytes; None means unavailable.

peak_bytes : int | None

Highest measured allocated bytes; None means unavailable.


See Also

BackendCapabilities

Describe measurements a collector can actually provide.

LineStats

Aggregate a visible source line without inventing unsupported hit counts.

SparkExecutionStats

Keep wall duration separate from cumulative executor work.