Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-8640

BacklogTracer allocates 100k elements for an array even it is not enabled

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.15.1
    • Fix Version/s: 2.15.3, 2.16.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Novice

      Description

      By default each camel context has one BacklogTracer which is by default disabled.
      However BacklogTracer contains a queue with

      public static final int MAX_BACKLOG_SIZE = 100 * 1000;
      private final Queue<DefaultBacklogTracerEventMessage> queue = new ArrayBlockingQueue<DefaultBacklogTracerEventMessage>(MAX_BACKLOG_SIZE);
      

      The easiest way:
      is it possible to replace it with LinkedBlockingQueue(int capacity)?

      Ideally the object could be initialized only when it is enabled but it seems BacklogTracer is not fully encapsulated (the queue reference is maintained also outside BacklogTracer in BacklogTracerAdvice)

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              matihost Mateusz Nowakowski
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: