-
Notifications
You must be signed in to change notification settings - Fork 37.7k
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
annotations need to be cached (jvm concurrency issue) [SPR-8737] #13379
Comments
George Baxter commented Proposal.. caches method annotations as well, though those don't seem as necessary: /*
package org.springframework.core; import java.lang.annotation.Annotation; import org.springframework.util.Assert; /**
|
George Baxter commented Since the inserted code lost all formatting and really isn't clear what changes I made:
|
Chris Beams commented Thanks for the suggested fix, George. This issue has just been fixed based on #13936. Please give the latest 3.2.0.BUILD-SNAPSHOT a try and let us know (in comments on #13936) how it goes! |
George Baxter opened SPR-8737 and commented
Java has a concurrency issue when examining annotations on a method or method parameters (synchronized around a jam-wide weak hash map). In high concurrency environments, this becomes a bottleneck. The only current solution is to cache the annotations.
Currently, the MethodParameter class could cache the annotations based on the declaring class, the method and the parameter index. We might have been able to extend MethodParameter class to provide this caching, but unfortunately, the object is instantiated directly within the HandlerMethodInvoker.resolveHandlerArguments(..) (private method).
Currently a critical issue for us.
Affects: 3.0.5, 3.0.6
Issue Links:
The text was updated successfully, but these errors were encountered: