Not sure if my findings are correct, but during troubleshooting a classloader-leak seemingly related to jersey and com.fasterxml.jackson, I found the following (EMA screenshot attached):
Jersey is using hk2 for Injection.
Inside org.jvnet.hk2.internal.Utilities class we find a methodKeyCache field, which is a WeakHashMap.
The key is a Class<?> (and so far so good), but the value is HashSet of MemberKey, where backingMember is a method instance, but which (in this case unfortunately), contains a hard-reference to a Class<?> instance (which happens to be the same as the key).
This seems therefore a clear violation of the guideline described in the docs:
Implementation note: The value objects in a WeakHashMap are held by ordinary strong references. Thus care should be taken to ensure that value objects do not strongly refer to their own keys, either directly or indirectly, since that will prevent the keys from being discarded.
If this is by purpose, what is the proper way unloading the application? Initialization is currently done by extending ResourceConfig and registering my custom provider class class that again extends com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider.
Thanks in advance.
Matyas Bene
IT Manager for Development and Architecture
Phone +421 (907) 681816
matyas.bene_at_ferratum.com<mailto:matyas.bene_at_ferratum.com>
Ferratum Slovakia s.r.o.
Jakubovo nám 19
811 09, Bratislava, Slovak Republic
https://www.ferratum.sk/
[cid:image001.jpg_at_01CC7F83.C776D980]