NumPy slice views keep deleted array's buffer alive — diagnosing retained memory
Symptom After deleting a large NumPy array, process memory does not drop as expected. A slice or reshaped view created earlier still references the original data buffer, so the underlying allocation stays alive even though the base array name is gone. Constraints and uncertainty NumPy views share memory with their base array by design, and np.shares_memory c