If I am creating a bean which has a HTTPClient
and annotate a method in this bean with @Schedule
-> afterwars undeploy the app (e.g. tomcat or jboss) I am creating a Class Loader memory leak.
If I just delete the @Schedule
annotation, it takes a bit of time after undeployment, but then the HttpClientImpl$SelectorManager
is GCed.
I assume that the @Schedule
mechanic keeps a soft link to the class and therefor the HTTPClient
(which would normally allow it to be GCed), but the HttpClientImpl$SelectorManager
does not understand this and keeps open?!
Anybody having similar trouble or has an idea on it?
MAT: (I have 3 @Schedule
annotated classes / methods)
(openjdk build 11.0.9+11-LTS, spring boot 2.4.4)