@Cacheable annotation lead to a huge memory allocation from the side of OperationCache equals/hashCode [SPR-16490] #21033
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: duplicate
A duplicate of another issue
type: enhancement
A general enhancement
Alexander Fedorov opened SPR-16490 and commented
Hello Team,
we have faced a very intensive CPU consuming. One of the reason is very high GC activity.
GC activity could be splitted into two points:
Minor GC could be tuned with help of investigating of memory allocation events inside new TLAB.
Major GC could be tuned with help of investigating of memory allocation events outside TLAB.
We use JMC and JFR API for aggregating memory allocation events.
It looks like
Memory allocation events inside new TLAB
!allocation_inside_TLAB.jpg|thumbnail!
Memory allocation events outside TLAB
!allocation_outside_TLAB.jpg|thumbnail!
Where higlighted categories are:
Hotspots looks like:
!allocation_inside_TLAB_hotspots.jpg|thumbnail!
Issue is here:
!decompiled.jpg|thumbnail!
Our version is
But issue actual for latest version too.
I suggest that it could be implemented as below:
Main idea is caching and interning string objects for minimizing memory allocation from the side of method equals and compare int instead of String for hashCode.
Our cusomized version of [^CacheOperation.java] is attached.
Thank you!
Affects: 4.3.14
Attachments:
Issue Links:
@Transactional
annotation lead to a huge memory allocation during creation String representation of Method uses for logging onlyThe text was updated successfully, but these errors were encountered: