The default disruptor WaitStrategy used for Async Logging (com.lmax.disruptor.TimeoutBlockingWaitStrategy) is not garbage-free, because its implementation uses a java.util.concurrent.locks.ReentrantLock, which internally allocates many AbstractQueuedSynchronizer$Node objects.
This was fixed in https://github.com/LMAX-Exchange/disruptor/issues/227, where the ReentrantLock was replaced by a synchronized block, but this change is not included in the current production version 3.4.4 of LMAX Disruptor.
(LMAX Disruptor 4.0.0.RC1 does include this fix, but that version of the Disruptor requires Java 11 (in addition to some other incompatible changes), so upgrading to Disruptor 4.0.0 will not be a solution for this ticket - at least not for Java 8 users.)
I propose to introduce a new class org.apache.logging.log4j.core.async.TimeoutBlockingWaitStrategy that is a copy of the latest version of the disruptor's TimeoutBlockingWaitStrategy.java.
This would be the default WaitStrategy used by Log4j.
The only different between this and the current default WaitStrategy is that the new implementation uses a synchronized block instead of a ReentrantLock, so no temporary objects are allocated, making this WaitStrategy garbage-free.
This is the commit in the LMAX disruptor repo that has the change we are trying to introduce: