title: Memory Leak with EF Core Logging
body: <p>I have a small Digital Ocean droplet (1GB of RAM) running the most current Ubuntu LTS. I created a small DotNet core 3.1 MVC web app (+ DotNet Core identity) that eventually hits a task limit and then throws (erroneous) OOM exceptions.</p>
  <p>Representative Error messages from journalctl:</p>
  <pre><code> Microsoft.AspNetCore.Server.Kestrel[13] Connection id &quot;0HM1CRI33JJJE&quot;, Request id &quot;0HM1CRI33JJJE:0000043E&quot;: An unhandled exception was thrown by the application. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.Threading.Thread.StartInternal()
   at Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider..ctor(IOptionsMonitor`1 options)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at ... (etc)
  </code></pre>
  <p>Service status on fresh start:</p>
  <pre><code>Site.service - Description here
       Loaded: loaded (/etc/systemd/system/Site.service; enabled; vendor preset: enabled)
       Active: active (running) since Wed 2020-07-22 17:08:51 UTC; 48s ago
     Main PID: 656469 (Site)
        Tasks: 21 (limit: 1075)
       Memory: 103.4M
       CGroup: /system.slice/Site.service
  </code></pre>
  <p>Status output with problem active:</p>
  <pre><code> Site.service - Description here
       Loaded: loaded (/etc/systemd/system/Site.service; enabled; vendor preset: enabled)
       Active: active (running) since Wed 2020-07-22 17:08:51 UTC; 11min ago
     Main PID: 656469 (Site)
        Tasks: 1075 (limit: 1075)
       Memory: 176.1M
       CGroup: /system.slice/Site.service
  </code></pre>