From 1a11a64791ae1ab90d36bbcbf85eb2522297155a Mon Sep 17 00:00:00 2001 From: Sung Yoon Whang Date: Mon, 1 Jul 2019 23:19:07 -0700 Subject: [PATCH] Decrease EventListener buffer size (dotnet/coreclr#25526) * Reduce the default EventPipe circularBufferSize to 10MB for EventListener sessions * make it a static var instead of random # in the code Commit migrated from https://github.com/dotnet/coreclr/commit/f9a6e873747dbefeca9016e31378d532ce56f293 --- .../src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs index a58d4eb..4360283 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs @@ -36,6 +36,8 @@ namespace System.Diagnostics.Tracing private object m_dispatchControlLock = new object(); private Dictionary m_subscriptions = new Dictionary(); + private static uint DefaultEventListenerCircularMBSize = 10; + private EventPipeEventDispatcher() { // Get the ID of the runtime provider so that it can be used as a filter when processing events. @@ -110,7 +112,7 @@ namespace System.Diagnostics.Tracing new EventPipeProviderConfiguration(NativeRuntimeEventSource.EventSourceName, (ulong) aggregatedKeywords, (uint) highestLevel, null) }; - m_sessionID = EventPipeInternal.Enable(null, EventPipeSerializationFormat.NetTrace, 1024, providerConfiguration, 1); + m_sessionID = EventPipeInternal.Enable(null, EventPipeSerializationFormat.NetTrace, DefaultEventListenerCircularMBSize, providerConfiguration, 1); Debug.Assert(m_sessionID != 0); // Get the session information that is required to properly dispatch events. -- 2.7.4