You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Matteo Merli (JIRA)" <ji...@apache.org> on 2017/06/01 21:06:04 UTC

[jira] [Created] (BOOKKEEPER-1090) Use LOG.isDebugEnabled() to avoid unexpected allocations

Matteo Merli created BOOKKEEPER-1090:
----------------------------------------

             Summary: Use LOG.isDebugEnabled() to avoid unexpected allocations
                 Key: BOOKKEEPER-1090
                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-1090
             Project: Bookkeeper
          Issue Type: Improvement
            Reporter: Matteo Merli
            Assignee: Matteo Merli
            Priority: Minor
             Fix For: 4.5.0


Using {{LOG.debug(...)}} can lead to multiple unexpected memory allocation, even when the logger it's turned off.

For example, {{int}} and {{long}} parameter are boxed into {{Integer}} and {{Long}} objects and the var-arg parameters are using an {{Object[]}} to hold
them.

We should guard all usages of {{LOG.debug()}} with the {{if (LOG.isDebugEnabled()}} guard.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)