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

spring-projects-issues opened this issue Jan 22, 2014 · 1 comment
in: core status: backported type: enhancement


Copy link

@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

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.


@spring-projects-issues spring-projects-issues added status: backported type: enhancement in: core labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.0.1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: core status: backported type: enhancement
None yet

No branches or pull requests

2 participants