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

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

     [ https://issues.apache.org/jira/browse/BOOKKEEPER-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sijie Guo resolved BOOKKEEPER-1090.
-----------------------------------
    Resolution: Fixed

This change has been merged in master. Closing this jira now. Thank you [~mmerli]

> 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.4.14#64029)