Closed FlorianVen closed 1 year ago
@FlorianVen Thanks for reporting and providing a reproduction case. Could you please try running it with https://github.com/revoltphp/event-loop/pull/75/files applied to see whether that fixes the leak?
@kelunik Thanks for the quick reply, I've just applied the changes to the reproducer and they unfortunately do not fix the leak.
FYI: I'll be away the coming week, @Liiva will take over for me.
Could you please try https://github.com/revoltphp/event-loop/pull/78 instead? That PR takes a different approach to fixing the same leak in non-resumed fibers.
@trowski I applied the changes and no luck unfortunately, still seeing a memory usage increase each iteration.
@FlorianVen Please retry. Note that you should usually reuse the http client instance so the connections are reused.
@FlorianVen Please retry. Note that you should usually reuse the http client instance so the connections are reused.
Issue seems fixed, thanks a lot!
Looks like memory leak still exists in 4.x version, after switch to FFI HPackNgHttp2 to process http2 connection, process running after some days, php memory_get_usage() report about 100+MB memory usage, but in top, ps, php process memory up to 6GB, what??
This is the problems after I switch to FFI: https://github.com/amphp/hpack/issues/12
We have a lots of http connection job in whole day, beforer switch to ffi, memory never grow to GB.
We seem to be encountering a memory leak on
v5.0.0-beta.11
, reproducer here: https://github.com/FlorianVen/amphp-http-client-mem-leak-reproRelevant code:
I would have expected the reported memory usage to stay equal, instead it increases with each iteration (example down below).
The best clue I managed to find was that for each request performed, two callbacks remain in the EventLoop callbacks queue never seem to disappear ("k" and "l" in this screenshot after the first request):
I have tried finding the source of these callbacks but did not manage to find them.
PHP information + example run:
Please let me know what you think or if you need anything else.