def log_gc_stats_on_request_begin
      return do_nothing_on_null(:log_gc_stats_on_request_begin) if null?

      # See the docs for MUTEX on why we synchronize this.
      GC_MUTEX.synchronize do
        if OBJECT_SPACE_SUPPORTS_LIVE_OBJECTS
          @transaction.message('Initial objects on heap: ' \
            "#{ObjectSpace.live_objects}")
        end
        if OBJECT_SPACE_SUPPORTS_ALLOCATED_OBJECTS
          @transaction.message('Initial objects allocated so far: ' \
            "#{ObjectSpace.allocated_objects}")
        elsif OBJECT_SPACE_SUPPORTS_COUNT_OBJECTS
          count = ObjectSpace.count_objects
          @transaction.message('Initial objects allocated so far: ' \
            "#{count[:TOTAL] - count[:FREE]}")
        end
        if GC_SUPPORTS_TIME
          @transaction.message("Initial GC time: #{GC.time}")
        end
      end
    end
def log_gc_stats_on_request_begin
      return do_nothing_on_null(:log_gc_stats_on_request_begin) if null?

      # See the docs for MUTEX on why we synchronize this.
      GC_MUTEX.synchronize do
        if OBJECT_SPACE_SUPPORTS_LIVE_OBJECTS
          @transaction.message('Initial objects on heap: ' \
            "#{ObjectSpace.live_objects}")
        end
        if OBJECT_SPACE_SUPPORTS_ALLOCATED_OBJECTS
          @transaction.message('Initial objects allocated so far: ' \
            "#{ObjectSpace.allocated_objects}")
        elsif OBJECT_SPACE_SUPPORTS_COUNT_OBJECTS
          count = ObjectSpace.count_objects
          @transaction.message('Initial objects allocated so far: ' \
            "#{count[:TOTAL] - count[:FREE]}")
        end
        if GC_SUPPORTS_TIME
          @transaction.message("Initial GC time: #{GC.time}")
        end
      end
    end
rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
 @private