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

Use LOG.isDebugEnabled() to avoid unexpected allocations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 4.5.0
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: