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
common.MergeURL占用内存一直上升 #2031
Comments
@彭笳鑫 |
初步怀疑像先merge了一个 url,然后在把 url 更新到event里,下次从event里面在拿出来在 merge,有更详细的复现步骤么 @fubug |
try func MergeURL(serviceURL *URL, referenceURL *URL) *URL {
// After Clone, it is a new URL that there is no thread safe issue.
mergedURL := serviceURL.Clone()
// iterator the referenceURL if serviceURL not have the key ,merge in
// referenceURL usually will not changed. so change RangeParams to GetParams to avoid the string value copy.// Group get group
for key, value := range referenceURL.GetParams() {
if _, ok := mergedURL.GetNonDefaultParam(key); !ok {
if len(value) > 0 {
mergedURL.params[key] = value
}
}
}
// loadBalance,cluster,retries strategy config
methodConfigMergeFcn := mergeNormalParam(mergedURL.params, referenceURL, []string{constant.LoadbalanceKey, constant.ClusterKey, constant.RetriesKey, constant.TimeoutKey})
// remote timestamp
if v, ok := serviceURL.GetNonDefaultParam(constant.TimestampKey); !ok {
mergedURL.params[constant.RemoteTimestampKey] = []string{v}
mergedURL.params[constant.TimestampKey] = []string{referenceURL.GetParam(constant.TimestampKey, "")}
}
// finally execute methodConfigMergeFcn
for _, method := range referenceURL.Methods {
for _, fcn := range methodConfigMergeFcn {
fcn("methods." + method)
}
}
// In this way, we will raise some performance.
return mergedURL
} |
疯狂调用 MergeURL这个函数的确会内存上升,细节在定位 |
目前是有内存泄露的问题吗,其实上面那个图和top其实说明不了啥问题,如果有内存泄露的情况,发个复现步骤吧 |
如果可以的话,发一下内存的增长的截图。如果有条件的发下 内存 diff profile的log
|
截图失真比较严重,辛苦下载下来看下吧https://github.com/fubug/go/blob/main/start%20inuse_space.html |
稍等,我花时间整理个最小版本的代码 |
初步怀疑推送风暴,可以提供注册中心的推送日志么? |
目前怀疑跟多 zk 有关,这边用户把注册中心切换成 nacos 之后看着正常。 有类似问题的可以先切换试试。 root cause 我在跟一下 |
有一个用户使用了 zk v3.4.10,也遇到了这个问题。 |
这个问题还没有修复吗??调用链,config.Load->refConfig.Refer->common.MergeURL,没有调用很多次,咋来的内存溢出 |
平常状态下比较难复现,你也是 go 调用 java 么? |
go调java,我这边是可以复现的,直接用jmeter压测,内存很快就涨上来; |
这是我的配置文件
|
行,我今天测一下 |
能否在钉钉群 23331795 一块聊下? |
有没有结果 |
|
go.mod
|
|
Hello,你那边复现出来了吗? |
go 1.16, web gin, dubbo-go v3,zk 3.4.8 |
感恩的心 |
directory.go 文件吗?哪一行代码? |
什么时间封版本3.0.3 |
Now, we are releasing |
have to wait so long~!,i hope it can be fixed in v 3.0.5 |
1.5.8也出现这个问题了,请问3.0解决了吗 |
The text was updated successfully, but these errors were encountered: