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
泛化实现定义了含$invoke方法的MyGenericService。暴露服务时: GenericService genericService = new MyGenericService(); ServiceConfig<GenericService> service = new ServiceConfig<>(); service.setInterface("**"); service.setRef(genericService); service.setGeneric("true"); service.export();
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清空后还是没有回收对象。还有其他位置有相关引用么?
The text was updated successfully, but these errors were encountered: