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

Unnecessary class loading in AspectJ RuntimeTestWalker [SPR-11344] #15968

Closed
spring-projects-issues opened this issue Jan 22, 2014 · 1 comment
Closed

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jan 22, 2014

Juergen Hoeller opened SPR-11344 and commented

Within our AspectJ RuntimeTestWalker, the InstanceOfResidueTestVisitor resolves types via ClassUtils.forName(type.getName()). This can be become quite excessive and is fundamentally unnecessary, since the underlying AspectJ ReferenceType does hold the Class... It's just a bit buried.

The main problem is that a ClassLoader doesn't efficiently resolve classes that it loaded already. As a consequence, it cannot be treated as an efficient cache for class name -> Class. There is quite some lock contention going on there, at least on WebSphere's ClassLoader.


Affects: 3.2.6, 4.0 GA

Issue Links:

  • #16124 CompoundClassLoader.loadClass is trying to load some framework class and comsuming all web container threads.

Backported to: 3.2.7

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 22, 2014

Juergen Hoeller commented

Fixed through downcasting to AspectJ's ReflectionType and ReflectionBasedReferenceTypeDelegate, obtaining the myClass field there. We only fall back to regular class loading if we encounter any other kind of type.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants