Hi everyone,

I would like to ask a question about an issue that we faced regarding profiling 
memory usage:

We have implemented a custom memory profiler using 
`PyMem_GetAllocator/PyMem_SetAllocator` APIs like `tracemalloc`. Right now, we 
are facing an issue with numpy: numpy seems to have its own memory allocator 
and they use `PyTraceMalloc_Track` APIs to notify tracemalloc about the 
allocation. A simple search on GitHub reveals there are more projects using 
this approach: https://github.com/search?q=PyTraceMalloc_Track&type=code which 
is fine. I believe it is common to use custom memory allocators for scientific 
computation which makes perfect sense.

However, I would have expected to have at least some form of 
`PyMem_NotifyAllocator` type of API instead of a one that is specific to 
`tracemalloc`? I might be missing some context here. 

WDYT?

Best,
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/BHOIDGRUWPM5WEOB3EIDPOJLDMU4WQ4F/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to