Excessive heap garbage due to throw-away string creation
Excessive CPU due to computing hash code for the newly created strings.
In our spring context present 1200+ beans and ~20 beanPostProcessors as result E2E spenario for 30 minute generate ~300GB char
It our problem that legacy part of system use BeanFactory.getBean instead of inject dependency correctly. But problem described above also affect application start time because spring for inject dependency also do getBean by Class and as result spring for each class iterate by all beans in context and generate cache key like:
After some further consideration, AbstractAutoProxyCreator uses a prefixed bean name as its cache key now: either with the FactoryBean prefix "&" or just the plain bean name, depending on a type check. We therefore align it with our own recommendation in the BeanPostProcessor.postProcessAfterInitialization callback javadoc.