You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Jan Hindermann (Jira)" <ji...@apache.org> on 2021/07/22 12:36:00 UTC

[jira] [Created] (LOG4NET-671) LoggingEvent does not correctly dispose WindowsIdentity

Jan Hindermann created LOG4NET-671:
--------------------------------------

             Summary: LoggingEvent does not correctly dispose WindowsIdentity
                 Key: LOG4NET-671
                 URL: https://issues.apache.org/jira/browse/LOG4NET-671
             Project: Log4net
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.10
            Reporter: Jan Hindermann
         Attachments: Stacktrace.png, UndisposedHandles.png

LoggingEvent uses the [WindowsIdentity|https://docs.microsoft.com/en-us/dotnet/api/system.security.principal.windowsidentity?view=net-5.0] class to get the current user. After the required information is retrieved from the object, it is not disposed correctly, which means that it ends up in the finalizer queue (or rather, the handle objects that WindowsIdentity uses internally).

During the runtime of a sufficiently large application, this can lead to the finalizer queue having to process several thousands of undisposed objects. As the CLR does not guarantee that the finalizer thread will run, the memory may fill up with leaked objects.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)