You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a Macbook Pro(M2) and I almost never shut it down, only closing the lid. I have noticed that after using it for a long period of time, the memory usage of v2ray gradually increases. After profiling with pprof, I obtained the above result.
The issue seems to be related to pipe.ReadMultiBuffer. I suspect that some pipes do not exit properly due to idle connections not being reactivated. I temporarily modified the code to add an idle timeout closure, and this resolved the issue.
func (p*pipe) ReadMultiBuffer() (buf.MultiBuffer, error) {
for {
data, err:=p.readMultiBufferInternal()
ifdata!=nil||err!=nil {
p.writeSignal.Signal()
returndata, err
}
timer:=time.NewTimer(15*time.Minute) // new addselect {
case<-p.readSignal.Wait():
case<-p.done.Wait():
case<-timer.C: // new addreturnnil, buf.ErrReadTimeout// new add
}
timer.Stop() // new add
}
}
So, is there an elegant way to close these pipes, or using a timeout as I have done?
The text was updated successfully, but these errors were encountered:
What version of V2Ray are you using?
V2Ray 5.16.1
What's your scenario of using V2Ray?
Set as HTTPS_PROXY env
What problems have you encountered?
Memory Leak
Please attach your configuration here
Server configuration:
Client configuration:
Other configurations (such as Nginx) and logs here
http://localhost:6060/debug/pprof/
I am using a Macbook Pro(M2) and I almost never shut it down, only closing the lid. I have noticed that after using it for a long period of time, the memory usage of v2ray gradually increases. After profiling with pprof, I obtained the above result.
The issue seems to be related to pipe.ReadMultiBuffer. I suspect that some pipes do not exit properly due to idle connections not being reactivated. I temporarily modified the code to add an idle timeout closure, and this resolved the issue.
So, is there an elegant way to close these pipes, or using a timeout as I have done?
The text was updated successfully, but these errors were encountered: