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

GC problem when having Spring jars in a higher ClassLoader without using clearClassLoader [SPR-7227] #11886

Closed
spring-projects-issues opened this issue May 20, 2010 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented May 20, 2010

Thomas Risberg opened SPR-7227 and commented

GC problem when re-deploying bundles in dm Server 2.0.1. Looks like the GenericTypeAwarePropertyDescriptor is holding a reference to the class.

Class Name | Shallow Heap | Retained Heap


class com.test.Bean1 @ 0x2c34fb70 | 0 | 0
'- beanClass org.springframework.beans.GenericTypeAwarePropertyDescriptor @ 0x26c94110 | 96 | 152
'- value java.util.HashMap$Entry @ 0x26c92970 | 24 | 176
'- [3] java.util.HashMap$Entry[16] @ 0x26c91740 | 80 | 376
'- table java.util.HashMap @ 0x26c868d8 | 40 | 416
'- propertyDescriptorCache org.springframework.beans.CachedIntrospectionResults @ 0x26c74858 | 16 | 4,136
'- value java.util.WeakHashMap$Entry @ 0x26c5e7e0 | 40 | 4,176
'- [2] java.util.WeakHashMap$Entry[16] @ 0x26230850 | 80 | 98,408
'- table java.util.WeakHashMap @ 0x2622bb40 | 48 | 98,488
'- m java.util.Collections$SynchronizedMap @ 0x262275d8 | 32 | 98,520
'- classCache class org.springframework.beans.CachedIntrospectionResults @ 0x2bc554c8| 16 | 98,704
'- [157] java.lang.Object[320] @ 0x26229208 | 1,296 | 101,208



Affects: 3.0.2

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Glyn Normington commented

Please note that dm Server 2.0.x and Virgo users can upgrade the version of Spring used by applications. To do this, replace all the Spring framework bundles and the file org.springframework.spring-library-3.0.0.RELEASE.libd in repository/ext with a version of these files fixing this issue (target = 3.0.3) and clean start the server. Note that it is essential to replace those files in repository/ext and not mix Spring versions otherwise resolution failure will occur.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've revised CachedIntrospectionResults to only cache GenericTypeAwarePropertyDescriptors if fully safe. So if the Spring jars live in a higher ClassLoader and nobody called acceptClassLoader, we're only caching the basic JDK PropertyDescriptors, rebuilding our GenericTypeAwarePropertyDescriptor decorators on the fly as needed. This should be a good compromise between those different scenarios - reasonably efficient and with no potential for leaking.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants