When I call a coroutine without awaiting, in addition to a message warning me I have not awaited the coroutine, I also get the following warning message:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
I know how to fix this ie by awaiting the coroutine (and I do see a lot of questions about this warning, but all the answers are how to fix it; my goal is to understand it; please don't mark my question as duplicate if possible:) ); in particular, what I'd really like to understand is:
My goal in asking this is understanding the details and inner-workings of asyncio better.
tracemalloc is a module that is used to debug memory allocation in python
you can enable it by setting PYTHONTRACEMALLOC environment variable to 1
check the docs for more info Tracemalloc docs
It's a way how python manages memory and allocates memory for it's objects
I guess this is because memory is allocated and never used properly so we get loss of resources ie memory leak
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.