Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Memory Leak in AbstractBeanFactory, alreadyCreated HashSet not cleaned on failure in doGetBean [SPR-10896] #15524
In the doGetMethod the bean name to alreadyCreated HashSet but if there is a failure in creation this entry is not removed leading to a leak.
In our particular case the bean is a redirect with a name containing all of the unique parameters. getMergedLocalBeanDefinition, which is not in a try-catch block, throws a NoSuchBeanException therefore doGetBean throws without removing the entry from alreadyCreated.
And it would appear that at no other failure point in the method is the entry removed from Already created.
This has also be noted by CXF and worked around in their code (https://issues.apache.org/jira/browse/CXF-4795)
Which also lead to the same local fix in Mule (mulesoft/mule#21)
Affects: 3.2.4, 4.0 M3