dubbo-go
dubbo-go copied to clipboard
fix common.URL memory leak
Add the urlPool to manage the memory allocation of common.URL
check ci error.
We need all CI to pass to ensure code quality.
There are two questions. The first is why memory leaks occur here. The other question is that pooling can improve memory utilization but it does not seem to fundamentally guarantee that there will be no memory leaks.
There are two questions. The first is why memory leaks occur here. The other question is that pooling can improve memory utilization but it does not seem to fundamentally guarantee that there will be no memory leaks.
In the original issue, there is a profile screenshot that shows that this method holds the memory allocation.
This reset and release method needs to be called when dealing with the memory leak of type URL.
这 reset 函数怎么没有一个地方调用?
这 reset 函数怎么没有一个地方调用?
The user should call the Reset method when retrieving a URL structure from the pool.
这 reset 函数怎么没有一个地方调用?
The user should call the Reset method when retrieving a URL structure from the pool.
maybe u can submit a PR to dubbo-go-samples to show how to use it.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
这 reset 函数怎么没有一个地方调用?
The user should call the Reset method when retrieving a URL structure from the pool.
You mean that users should handle this manually? This is not a good idea, we should resolve this issue within dubbo-go itself. This approach would only increase the learning curve for users.
这 reset 函数怎么没有一个地方调用?
The user should call the Reset method when retrieving a URL structure from the pool.
You mean that users should handle this manually? This is not a good idea, we should resolve this issue within dubbo-go itself. This approach would only increase the learning curve for users.
You can offer your solution, and then we can discuss it.