Greetings, I am using blueprint DSL with camel 4.8.1 so I am not sure how much this reflects the current version, but I would really appreciate a good advice (or a moderate advice, or even a bad advice given with a good intentions).
Looks like each of my blueprint / camel-context creates a BeanComponent with LRU cache and caches quite a lot of messages. Some of my routes handles big messages (tens of megabytes) so I have several GB of memory tied in those caches. Is there a way to decrease the size of that cache? Or tweak its parameters in any other way? Spooling the messages to the disk is not an option, as I need to search them and work with them inside the route. Follows a dominator tree from MAT to show the issue more clearly: Class Name | Shallow Heap | Retained Heap | Percentage ------------------------------------------------------------------------------------------------------------------------------------ org.apache.camel.component.bean.BeanComponent @ 0x56a58ec70 | 56 | 2,982,317,624 | 40.82% |- beanInfoCache org.apache.camel.support.cache.SimpleSoftCache @ 0x56a58ed10 | 16 | 2,982,317,464 | 40.82% | '- delegate org.apache.camel.support.cache.SimpleLRUCache @ 0x56a58ed20 | 88 | 2,982,317,448 | 40.82% | |- org.apache.camel.component.bean.BeanInfoCacheKey @ 0x5a5b00d30 | 24 | 33,555,576 | 0.46% | | '- instance org.apache.camel.http.common.HttpMessage @ 0x59264ef40 | 64 | 33,555,552 | 0.46% | | |- body org.apache.camel.converter.stream.InputStreamCache @ 0x5cde141c8 | 32 | 33,554,480 | 0.46% | | |- headers org.apache.camel.util.CaseInsensitiveMap @ 0x5cde13e18 | 48 | 944 | 0.00% | | |- traits java.util.EnumMap @ 0x59264ef80 | 40 | 64 | 0.00% | | '- Total: 3 entries | | | | |- org.apache.camel.component.bean.BeanInfoCacheKey @ 0x5be1bc718 | 24 | 33,555,576 | 0.46% | |- org.apache.camel.support.DefaultExchange @ 0x5d1d0b610 | 72 | 23,247,912 | 0.32% | |- org.apache.camel.support.DefaultExchange @ 0x59264efc0 | 72 | 19,049,808 | 0.26% | |- org.apache.camel.component.bean.BeanInfoCacheKey @ 0x57e7d0580 | 24 | 16,778,480 | 0.23% | '- Total: 5 of 15,536 entries; 15,531 more | | | org.apache.camel.component.bean.BeanComponent @ 0x54b22ade8 | 56 | 1,284,273,280 | 17.58% org.apache.camel.component.bean.BeanComponent @ 0x5649a35d8 | 56 | 902,443,800 | 12.35% ------------------------------------------------------------------------------------------------------------------------------------ kind regards Mirek Borský
