vy opened a new pull request, #1401:
URL: https://github.com/apache/logging-log4j2/pull/1401

   This work moves `Recycler` et al. from `log4j-layout-template-json` to 
`log4j-api` and replaces `ThreadLocal` usages with `Recycler`s wherever 
possible. (It is based on @jvz's draft in #1194.)
   
   h2. Why is this a good idea?
   
   `ThreadLocal`s
   * provide one way of caching things
   * has significant memory tax on threaded applications
   * can cause memory leaks in the presence of multiple class loaders
   
   `Recycler` abstraction addresses these pain points by
   * abstracting away the caching mechanism – one can decide to disable it, use 
a queue with a limited capacity, switch back to old behavior by using a 
`ThreadLocal`-based implementation, or provide a custom one
   * enabling its configuration from a central place
   
   See [JSON Template Layout's 
documentation](https://logging.apache.org/log4j/2.x/manual/json-template-layout.html#recycling-strategy)
 on it for details.
   
   h2. What are the change highlights?
   
   * Added `Configuration#getRecyclerStrategy()` and 
`LoggingSystem.getRecyclerStrategy()`
   * `ThreadLocal`s in appenders and layouts are replaced with recyclers
   * Added `ReusableLogEvent` interface (implemented by `MutableLogEvent` and 
`RingBufferLogEvent`)
   * Adapted `StringBuilderEncoder`
   
   h2. What further needs to be done?
   
   - [ ] fix failing tests
   - [ ] write/update docs


-- 
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: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to