From: Michael Friedrich Date: Thu, 17 Aug 2017 16:03:37 +0000 (+0200) Subject: Change FIFO::Optimize() frequency for large messages X-Git-Tag: v2.8.0~104^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=732a5849d5a0d682368d120af0742a2fd3ccd4b3;p=icinga2 Change FIFO::Optimize() frequency for large messages refs #5513 --- diff --git a/lib/base/fifo.cpp b/lib/base/fifo.cpp index 602899489..374a877c8 100644 --- a/lib/base/fifo.cpp +++ b/lib/base/fifo.cpp @@ -67,7 +67,7 @@ void FIFO::ResizeBuffer(size_t newSize, bool decrease) */ void FIFO::Optimize(void) { - if (m_Offset - m_DataSize > 1024) { + if (m_Offset > m_DataSize / 10 && m_Offset - m_DataSize > 1024) { std::memmove(m_Buffer, m_Buffer + m_Offset, m_DataSize); m_Offset = 0;