carterkozak commented on pull request #452:
URL: https://github.com/apache/logging-log4j2/pull/452#issuecomment-752746126


   I think the `OutOfMemoryError` handling is critical. Consider an application 
which gets a spike of requests and fills heap (outside of the logging 
components) however an asynchronous logging event happens to trigger the first 
`OutOfMemoryError`. In this case we wouldn't want to stop processing the 
disruptor queue and block the application because that would make things even 
worse, we prefer to gracefully swallow the failure and provide as much detail 
as possible (see 
[AbstractAsyncExceptionHandler.java](https://github.com/apache/logging-log4j2/blob/913e87d7747aa8d90b7bd3236c4dca2e3307336a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AbstractAsyncExceptionHandler.java)).
   
   In an ideal world everyone would use `-XX:+CrashOnOutOfMemoryError` to avoid 
thinking about OMEs, but that has drawbacks in some environments as you might 
imagine :-)


----------------------------------------------------------------
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]


Reply via email to