jshen28
jshen28
I saw fluent-logger uses [`threading.Local`](https://github.com/fluent/fluent-logger-python/blob/ace80f4c2bd0020fc16891440243663c612dd01e/fluent/sender.py#L75) to store last errors, but does it make sense when it is running in an eventlet? I found, although it could be wrong observation, by...
I understand, but I am still interested why last_error is stored and how can I take advantage of it. Because I am afraid this may not be easy to solve...
I also try **python2** (with different package version) and looks like memory is not increasing too much but program feels significantly slower to me.
Thank you for reply. * I do try to use `gc.collect` but no luck. I also find if I comment out `monkey_patch` seems memory usage back to normal. * 100MB...
Thank you for investigation! * Do you also try if there is no server listening, because for me, memory boosts faster if fluent agent does not working properly. * Using...
I try to remove [`last_error`](https://github.com/fluent/fluent-logger-python/blob/master/fluent/sender.py#L75) which is a `threadLocal` variable, and looks like it could reduces some memory usage.
I come up with a new demo which could somehow reproduce the high memory usage, it is a copy of `sender.py` but without actually sending data out. During test, IP/Port...
Looks like even without try/catch phrase, it still could reproduce the problem. ```python def work(): threading.local().last_error = '123' pool = GreenPool() [pool.spawn(work) for _ in range(N)] pool.waitall() ```
Hmm... could you try `[pool.spawn(work) for _ in range(N)]`? ```console # uname -a Linux compute-010 5.10.83 #3 SMP Fri Dec 3 11:13:00 CST 2021 x86_64 x86_64 x86_64 GNU/Linux # python3...
```python def work(): try: raise Exception() except Exception as e: threading.local().last_error = e pool = GreenPool() [pool.spawn(work) for _ in range(N)] pool.waitall() ``` * if I replace `[pool.spawn(work) for _...