java - Memory leak in between Jersey @BeanParam and HK2 ServiceLocatorImpl -
we've been running bailiwick of jersey in production while , noticed started leaking memory. when digging discovered starting in hk2 2.3.0 there injecteetoresolvercache added hk2 class (org.jvnet.hk2.internal.servicelocatorimpl.class)
here's line servicelocatorimpl.class
private final cache<injectee, injectionresolver<?>> injecteetoresolvercache = new cache<injectee, injectionresolver<?>>(new computable<injectee, injectionresolver<?>>() in our setup we're using bailiwick of jersey 2.9 (hk 2.3.0) , have resource methods utilize @beanparam :
public customresponse getstuff( @beanparam paging paging, @beanparam custfilter filter){... what seems happening hk2 2.3.0 caching each instance of marked beanparameter injectee in injecteetoresolvercache. since new instances of "paging" , "filter" beanparams created on every phone call "getstuff" resource there 2 new entries added cache on every call. wound on 10 1000000 entries in cache before things started falling apart.
has else run or using framework incorrectly ?
for we've downgraded bailiwick of jersey 2.8 , seems working since depends on 2.2.0 of hk2 doesn't have injectee cache.
thanks! kris
we have found cause of memory leak, require changes between both hk2 , jersey. hk2 allowed bad usages of 1 of api has since been explicitly checked , disallowed. bailiwick of jersey uses api in way, means bailiwick of jersey have alter else. has not happened yet will.
java jersey jersey-2.0 hk2
No comments:
Post a Comment