Skip to content

Providing unique names to prototype inner beans causes excessive memory and CPU use [SPR-11545] #16170

Closed
@spring-projects-issues

Description

@spring-projects-issues

Charles Yates opened SPR-11545 and commented

We have a web application that averages around 30 hits per minute. After upgrading Spring from 3.2.5 to 3.2.7 we observed some problems. Over a period of one week there was a slow increase in heap usage resulting in OutOfMemoryErrors, and a gradual increase in CPU per request by a factor of ten.

CPU profiling shows the bulk of the time increase is in the method adaptInnerBeanName of BeanDefinitionValueResolver. Heap analysis shows the increase in memory use is in the ConcurrentHashMaps dependentBeanMap and dependenciesForBeanMap of DefaultSingletonBeanRegistry.

This problem appears to be a result of commit d0fc38e, the fix for issue #15757.

This application uses something on the order of 100 or so prototype beans per request. Over time providing these beans with unique names is an unmanageable proposition.


Affects: 3.2.6, 3.2.7, 3.2.8

Issue Links:

Backported to: 3.2.9

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions