AllocationRecorder¶
Qualified name: algan.utils.memory\_utils.AllocationRecorder
- class AllocationRecorder[source]¶
Bases:
objectCaptures every
ManualMemoryallocation into a scope tree.get_tensoris the arena’s single allocation entry point, so recording there covers every current and future buffer with no per-site annotation. That is what lets the memory tables be regenerated by measurement rather than maintained by hand.Methods
Drop scopes left open by an aborted render.
note_allocnote_temppop_scopepush_scopeEvery recorded scope with
name, outermost first.Attributes
current- clear()[source]¶
Drop scopes left open by an aborted render.
ManualMemory.resetruns while an OOM is still unwinding, so any open scope holds a truncated event stream that stops at the failing allocation. Detaching those keeps a partial measurement from being mistaken for a complete one – which would bias a calibrated coefficient downwards, the one direction that causes OOMs. They stay onabandonedfor diagnostics.