Github user clebertsuconic commented on the issue:
https://github.com/apache/activemq-artemis/pull/1361
@franz1981 if you were using a thread local on activeMQBuffer and
unsafeByteBufWrapper I would agree with you on saving GC.
however... Page won't last much longer on a regular scenario. The Page will
be served through PageCursorProviderImpl::getPageCache(); So.. this will be
read basically only once... or if the cache on the PageCursorProviderImpl is
beyond the limit, then the whole Page object would go away.
so, you won't ever read it twice if you get the opportunity of reusing the
field you're trying to reuse. it will probably be from a different object at
the time you get there.
So, I would say either use a ThreadLocal, or keep it the way it is.. since
the Objects you are caching will be GCed from the released Page when the cache
is full anyways.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---