release the allocated memory of the ‘url’ field when destroy invoker
Closed this issue · 1 comments
What would you like to be added:
Lines 92 to 96 in faf6f2a
here is my question, since the invoker is destroyed ,so why do we not set the url field in invoker to nil ,like below
func (bi *BaseInvoker) Destroy() {
logger.Infof("Destroy invoker: %s", bi.GetURL())
bi.url = nil //add this
bi.destroyed.Store(true)
bi.available.Store(false)
}
Why is this needed:
in this line, the invoker will be add to a global var dubboProtocol
dubbo-go/protocol/dubbo/dubbo_protocol.go
Line 98 in faf6f2a
dubbo-go/protocol/dubbo/dubbo_protocol.go
Line 59 in faf6f2a
so when destroy the invoker, the 'url' is useless and still it cannot be gc(unless destroy the global var),which i think may cause memory leaks