-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: the buff of eventloop.cache used cannot be released #659
Comments
The Did it lead to any issues? |
|
There is one buffer for each event loop and the number of the event loops is typically equal to the number of CPU. Besides, the buffer size is not expected to be large because it only caches the bytes every time you read data from the connection. When you said "a large amount of memory", how many bytes were you referring to? Any statistics you can show me? |
|
This is uncanny, normally |
reduce the code:
|
|
What's this |
const ( In addition, the mem growed location is 'buff, err := c.Peek(length)' |
actually, we decode the one packet every time as the code pasted above:
dont return the |
How big is a packet? Also, what's the version of |
Sorry,gent version is 'v2.5.2', mistakenly viewed the gnet version as the linux version. The average size of packets should generally not exceed 32k; under certain exceptional circumstances, it may double, may be grow to a few megabytes. |
If you keep reading data until |
Like over one hundred megabytes? |
impossible to exceed 10 M |
I think using |
This could work for I'll run some tests with big packets and see if it can reproduce your issue. Next move will depend on the test result. |
Updated Never mind, I've tracked down the root cause and fixed it. #660 should fix this issue. However, I discovered another uncanny "issue" when I did pprof on |
Yes, i just have found this problem, I'm trying to slove it |
Enable ET mode is a temporary solution ? |
open a new issue about the ringbuf: #662 |
Actions I've taken before I'm here
What happened?
the buff of eventloop.cache always occupied
Major version of gnet
v2
Specific version of gnet
github.com/panjf2000/gnet/v2 v2.5.2
Operating system
Linux
OS version
Linux 6.2.0-39-generic x86_64
Go version
1.21.6
Relevant log output
Code snippets (optional)
1
How to Reproduce
the buff of eventloop.cache always occupied after no data communication
Does this issue reproduce with the latest release?
It can reproduce with the latest release
The text was updated successfully, but these errors were encountered: