The line you identify in assertion util is only executed if assertions are enabled. You can turn on debug if you pass the system property or it is automatically on if you enable assertions. Normally, for production you don't pass the flag and don't enable assertions. Thus, the default is disabled.
On Thu, Nov 1, 2018 at 9:57 AM Zhenyuan Zhao <zzy...@gmail.com> wrote: > Hi Folks, > > I recently realized that BaseAllocator.DEBUG is always true: > > > https://github.com/apache/arrow/blob/e69659d9cb4b895dcc45a8f10979789dc2324872/java/memory/src/main/java/org/apache/arrow/memory/BaseAllocator.java#L38 > > https://github.com/apache/arrow/blob/e69659d9cb4b895dcc45a8f10979789dc2324872/java/memory/src/main/java/org/apache/arrow/memory/util/AssertionUtil.java#L27 > > I noticed it because by enabling debugging, it logs the history of bytebuf > allocation which uses significant amount of CPU. I don't see a way of > disabling it other than using reflection. Is this intentional? > > Thanks, > Zhenyuan >