From f2380590f907ef49ebee89c07a8bef9d60acf358 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 14 Nov 2021 18:13:34 +0100 Subject: [PATCH] Limit server query space to 8K entries. In the default configuration this limit is unlikely to be hit. On Windows the send buffer is 64 KB, which results in ~5K entries. On Linux the buffer is a bit higher and the number of entries is lower than 7K. --- server/TracyWorker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 3a46a520..51c52c1f 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -3077,7 +3077,7 @@ void Worker::Exec() } } - m_serverQuerySpaceBase = m_serverQuerySpaceLeft = ( m_sock.GetSendBufSize() / ServerQueryPacketSize ) - ServerQueryPacketSize; // leave space for terminate request + m_serverQuerySpaceBase = m_serverQuerySpaceLeft = std::min( ( m_sock.GetSendBufSize() / ServerQueryPacketSize ), 8*1024 ) - 4; // leave space for terminate request m_hasData.store( true, std::memory_order_release ); LZ4_setStreamDecode( (LZ4_streamDecode_t*)m_stream, nullptr, 0 );