Skip to content

how memray works? #225

Answered by godlygeek
ziyoujiyi asked this question in Q&A
Oct 11, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

I should write some docs on this, but we don't have any today. I'll try to explain some stuff here, with a goal of eventually writing some docs that explain this all.

There's basically 4 different major pieces to how Memray captures information about allocations:

  1. Detecting when memory is allocated from the system or deallocated (via malloc, free, realloc, etc)
  2. Recording the Python stack associated with each of those allocations
  3. Optionally recording the native stack associated with each of those allocations (when --native is used)
  4. Optionally also detecting allocations via the Python allocators (when --trace-python-allocators is used)

Detecting when memory is allocated

Any C or C++ extens…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@godlygeek
Comment options

@xiaoniaoyouhuajiang
Comment options

@godlygeek
Comment options

@xiaoniaoyouhuajiang
Comment options

Answer selected by pablogsal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants