[
https://issues.apache.org/jira/browse/BOOKKEEPER-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16033859#comment-16033859
]
ASF GitHub Bot commented on BOOKKEEPER-1090:
--------------------------------------------
Github user jvrao commented on the issue:
https://github.com/apache/bookkeeper/pull/179
can't we come up with a macro to wrap this? Chane looks fine to me though.
+1
> 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)