utils

utils/memory.ts

memoryStats

(targetNetworks: any) => import("/home/runner/work/NeatapticTS/NeatapticTS/src/utils/memory").MemoryStats

Capture heuristic memory statistics for one or more networks with snapshot of active config flags.

Parameters:

MemoryStats

Memory instrumentation utilities (Phase 0).

Educational overview: These helpers expose a heuristic snapshot of memory usage for the evolutionary population and internal pools. The goal is to help learners reason about how design choices (slab storage, pooling, typed arrays) influence memory footprint without incurring heavy introspection costs.

Design principles:

registerTrackedNetwork

(network: any) => void

Register a network for inclusion in future memoryStats() calls made without explicit parameters.

Duplicate registrations are ignored; insertion order is preserved which is useful for deterministic test snapshots.

Parameters:

resetMemoryTracking

() => void

Reset internal tracking registry (and, in later phases, ancillary counters).

Educational: Calling this does NOT free memory — it simply clears the list of networks that will be included when memoryStats() is invoked without arguments. Use it between benchmark runs to isolate scenarios.

unregisterTrackedNetwork

(network: any) => void

Remove a previously registered network from the tracking registry. No-op if the network is not currently registered.

Parameters:

Generated from source JSDoc • GitHub