Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce memory consumption for caches [SPR-13093] #17684

Closed
spring-projects-issues opened this issue Jun 2, 2015 · 1 comment
Closed

Reduce memory consumption for caches [SPR-13093] #17684

spring-projects-issues opened this issue Jun 2, 2015 · 1 comment
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jun 2, 2015

Phil Webb opened SPR-13093 and commented

Currently several classes in the framework use ConcurrentReferenceHashMap with soft references for caching. Unfortunately soft references only get cleared when the JVM is completely out of memory making it appear that Spring is consuming a lot of resources.

We could create a dedicated MemoryCache abstraction with additional bounds to ensure that no individual cache is consuming too much memory.

Another, perhaps simpler approach, could be to clear caches after the ApplicationContext has loaded. The ResolvableType cache especially could benefit from this approach.


Affects: 4.1.6

Issue Links:

  • #16851 Reduce BeanDefinition cloning in AbstractBeanFactory.getMergedBeanDefinition
  • #18357 ReflectionUtils cache uses up a fairly big chunk of heap even

0 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jun 15, 2015

Juergen Hoeller commented

AbstractApplicationContext resets the ResolvableType and CachedIntrospectionResults caches after the refresh phase now.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants