Skip to content
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

通过泛化实现暴露的服务,注销服务时MyGenericService对象不回收 #11218

Open
1 task
ZouYicheng opened this issue Dec 29, 2022 · 2 comments
Open
1 task
Labels
status/waiting-for-feedback Need reporters to triage

Comments

@ZouYicheng
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Ask your question here

我在做一个通过泛化实现和泛化调用实现类似网关的项目。即把MyGenericService服务暴露成自定义接口名。当接口弃用时把该服务注销。但我发现注销后MyGenericService对象没有回收。我担心随着服务越来越多,内存占用越来越多发生oom。

泛化实现定义了含$invoke方法的MyGenericService。暴露服务时:
GenericService genericService = new MyGenericService(); ServiceConfig<GenericService> service = new ServiceConfig<>(); service.setInterface("**"); service.setRef(genericService); service.setGeneric("true"); service.export();

注销服务时调用了service.unexport(),并且执行了GC。但genericService和service对象没有回收掉。
我发现ServiceRepository类中的services和providers中有相关引用,但我调用destroy清空后还是没有回收对象。还有其他位置有相关引用么?

@AlbumenJ
Copy link
Member

升级到 3.1.4 版本后还有吗

@Charcla
Copy link

Charcla commented Dec 19, 2023

是不是ReferenConfig没有destroy,我发现referenceConfig和genericService之间有循环引用,所以无法gc掉

@AlbumenJ AlbumenJ removed the question label Mar 8, 2024
@wxbty wxbty added the status/waiting-for-feedback Need reporters to triage label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/waiting-for-feedback Need reporters to triage
Projects
None yet
Development

No branches or pull requests

4 participants