stevedlawrence commented on PR #1539: URL: https://github.com/apache/daffodil/pull/1539#issuecomment-3207516175
> Note that if you ignore things like onstack and just allocate and allow GC of these objects then it can become quite hard to profile code because it all behaves like an inner loop calling the allocator. It feels OnStack and ThreadSafePool aren't that much different from an allocation perspective. The only difference is one stores the pool of things in a concurrent linked list, the other stores the pool of things in Thread-specific Stack. > OnStack can be made leak-safe if you just keep a counter and every N (ex: 100) calls just drop all existing entries from the pool and start fresh. That minimizes the size of leaks, but in the case where a DataProcessor is no longer accessible then there won't be any more calls to the OnStack functions, so there won't be anything to trigger a removal. I'm fine leaving OnStack as-is for now. I don't suspect the leaks will be significant in the majority of cases. But it's something to keep an eye out for. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
