-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Christoph Dreis opened SPR-14760 and commented
Hey,
in some of my recent tests I noticed a rather "high" pressure on the heap coming from TransactionAspectSupport.methodIdentification(). (The image below shows the result of a 10 minute flight recording) for StringBuilder.append(String). Of course there are some more MBs (~200) allocated for the StringBuilder and the actual toString() calls - in case you need this data as well - just tell me.
!transaction-methodIdentification.jpg|thumbnail!
As far as I understood the method it's "just" used for logging and monitoring - both of which are disabled in most situations, I'd say. Is this observation correct? Unfortunately, I didn't figure out yet how to implement my own version of TransactionAspectSupport inside a Spring-Boot app in order to workaround the problem at least for us, but that might be an issue for Boot after all.
Nonetheless, I attached a small PR that should at least force the compiler to concat the dot with a char instead of a String. Maybe this is the first step for 4.x until you can maybe come up with something smarter in 5.x.
Cheers,
Christoph
Affects: 4.3.3
Attachments:
- transaction-methodIdentification.jpg (67.74 kB)
Issue Links:
- @Transactional annotation lead to a huge memory allocation during creation String representation of Method uses for logging only [SPR-16492] #21035
@Transactionalannotation lead to a huge memory allocation during creation String representation of Method uses for logging only ("is duplicated by") - Consistent comma splitting without regex overhead (e.g. in MediaType/MimeType) [SPR-14635] #19202 Consistent comma splitting without regex overhead (e.g. in MediaType/MimeType)
Referenced from: pull request #1186