cloudtay / ripple

🚀 A modern, high-performance, native PHP coroutine engine.
https://github.com/cloudtay/ripple
MIT License
129 stars 7 forks source link

There may be a memory leak #30

Open summer-boythink opened 1 month ago

summer-boythink commented 1 month ago

When I run ./vendor/bin/phpunit, although the final result of test is OK, it takes 30min to run the result.

There may be a memory leak ?

image

Here is my development environment

image image

cclilshy commented 1 month ago

Can you confirm which process takes longer to execute? This is most likely because some of the built-in urls in HttpTest have relatively high latency relative to your network environment

summer-boythink commented 1 month ago

@cclilshy Thank you for your reply. I tried test again, and this time I found the part of test that was blocked

image
summer-boythink commented 1 month ago

I try to solve it myself first, it seems that wait() is waiting forever

cclilshy commented 1 month ago

I noticed that I had a number of commits today that included changes to $stream->write, and I recommend pulling the latest code again

As for the \Co\wait method, it will wait for all events to finish, including $stream->onReadable events that have not been canceled.

Thanks for your feedback, it is very helpful for this project, and I will pay special attention to this phenomenon happening in 'SocketTest'

In addition, if you have new findings, welcome to feedback with me

cclilshy commented 1 month ago

the purpose of this test is to check whether ripple can guarantee write integrity when the data is larger than the buffer, which may be related to the size of your socket buffer:

Smaller buffers take longer

If the final results of this test pass, you can trust ripple to work properly