Uploaded image for project: 'Bookkeeper'
  1. Bookkeeper
  2. BOOKKEEPER-1090

Use LOG.isDebugEnabled() to avoid unexpected allocations

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5.0
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mmerli Matteo Merli
                Reporter:
                mmerli Matteo Merli
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: