[ 
https://issues.apache.org/jira/browse/LOG4NET-671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17452045#comment-17452045
 ] 

Erik Mavrinac commented on LOG4NET-671:
---------------------------------------

PR: [(LOG4NET-671) Dispose WindowsIdentity in TryGetCurrentUserName() by erikma 
· Pull Request #79 · apache/logging-log4net 
(github.com)|https://github.com/apache/logging-log4net/pull/79]

> 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
>            Priority: Major
>         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.20.1#820001)

Reply via email to