In a spring MVC application, I initialize a variable in one of the service classes using the following approach:
ApplicationContext context = new C
Object obj = context.getBean("bean"); if(bean instanceof Bean) { Bean bean = (Bean) obj; }
In my case leak disappears