Message371550
Hello!
I am having issues with asynchronous generators not being garbage collected at least until the current loop has completed.
In the attached test case (test.py), one starts iterating over an asynchronous generator, then breaks and returns the first element. After each call, gc.collect() is invoked for illustration purposes.
It seems that no memory is freed until the whole test() coroutine is done.
The for-loop could obviously be extended to more iterations, or swapped out to a while-loop to easily run out of available memory.
I have then removed all async stuff, producing test_sync.py (also attached). In the sync case, everything is garbage-collected as I would expect. |
|
Date |
User |
Action |
Args |
2020-06-15 14:27:50 | vytas | set | recipients:
+ vytas, asvetlov, yselivanov |
2020-06-15 14:27:50 | vytas | set | messageid: <1592231270.66.0.0853044039719.issue40986@roundup.psfhosted.org> |
2020-06-15 14:27:50 | vytas | link | issue40986 messages |
2020-06-15 14:27:50 | vytas | create | |
|