Affects Version/s: 2.x
Fix Version/s: None
Environment:Linux 64-bit, Java 1.6, Tomcat, Grails
Number of attachments :
We have a Grails application serving hundreds of requests per second and this seems to be the most critical hot spot for us. Under high load, most threads are blocked in the following call stack:
Grails uses InvokerHelper a lot, which calls ClassInfo.getMetaClass which uses locking. This is stop-the-world lock affecting all threads (they all hit the same ClassInfo instance). Note that 99,999% of time the locking is useless as nothing is modified (typically all metaclasses getting modified on startup).
The solution could be to use more fine-grained locks (ReadWriteLock) or Atomics. Should be easy to implement, but need to isolate modification part from read-only parts.
Doing so can be a good boost to overall Grails performance.
|Affects Version/s||1.7.x [ 15538 ]|
|Affects Version/s||1.8.x [ 15750 ]|
|Component/s||groovy-runtime [ 16250 ]|