py-spy icon indicating copy to clipboard operation
py-spy copied to clipboard

[Question] Is it possible to extract memory allocations (including global/local variables)?

Open mmtftr opened this issue 11 months ago • 1 comments

Description

After seeing how well this program worked, I wondered if py-spy could dump the memory of a python program and parse it to get a representation of memory allocations (like a heap profiler). My specific use case was to recover some state from a running program which would help with debugging on-the-fly

mmtftr avatar Jan 23 '25 07:01 mmtftr

We do have some limited ability to show memory of local variables - via the py-spy dump --locals flag - which might be useful to you.

benfred avatar Jul 12 '25 18:07 benfred