carterkozak commented on pull request #390: URL: https://github.com/apache/logging-log4j2/pull/390#issuecomment-660516966
@rgoers, I'd appreciate your feedback on this change when you have time. I'm primarily interested in whether or not you think it's reasonable to replace `Thread.getAllStackTraces()` with the simpler current-thread check, applications with several thousand threads will suffer creating large arrays, and loading many stack traces unnecessarily. If the cross-thread check is a requirement, I think the following could work: 1: First check the current thread at construction time, if it matches the event thread name there's no more work to do 2: When an identifier or priority is first requested, we can attempt to use ThreadMXBean.getAllThreadIds and use the result to call getThreadInfo with maxDepth zero to avoid forcing a safepoint and reduce the heap requirement of the result. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
