logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominik Psenner" <dpsen...@gmail.com>
Subject AW: log4net.dll version (FileSystemWatcher objects)
Date Fri, 24 May 2013 06:27:55 GMT
Good morning Yuvraj,


There's no way of being sure unless you have tried it out with your
application or a sample application that uses log4net in the same way you
do. Of course a sample application could do things faster than normal and in
an automated way so that the problem happens sooner and not only after 3
months. :)


So my testing setup would be two identical virtual machines. The first runs
the application against 1.2.10 and the second runs the application against
1.2.11. This way you can expect to see:


*         Virtual machine #1 leaks memory

*         Virtual machine #2 either does or doesn't leak memory




Von: Yuvraj Raj [mailto:rajy@michaels.com] 
Gesendet: Donnerstag, 23. Mai 2013 20:27
An: log4net-dev@logging.apache.org
Betreff: log4net.dll version (FileSystemWatcher objects)




I am application developer team supporting.NET project in Michaels Stores.
We have been using log4net.dll version for application logs for our
project. The application is implemented in .NET , C# with 3.5 framework.


Recently we have faced System.OutOfMemoryException exception thrown by the
application. We have opened case with Microsoft.  Microsoft analyzed and
said memory consumption is due to FileSystemWatcher objects used by
log4net.Config.XmlConfigurator+ConfigureAndWatchHandler which are still
alive and pinned objects.


>From the memory dump, They found >2000 instances of
log4net.Config.XmlConfigurator+ConfigureAndWatchHandler and the
FileSystemWatcher objects created that contributed this issue. The issue is
happening due to the fragmentation of Gen2 Heap. The reason for the
fragmentation is the pinned System.IO.Overlapped objects used by
FileSystemWatcher objects.


To resolve the memory  issue, we need to get rid of the fragmentation caused
by pinned objects used by FileSystemWatcher objects


We have created logger object in singleton class but not sure how multiple
objects are being created.


When looking at the log4net.dll help from Apache web page, we found the
below link for log4net that have bug (LOG4NET-158) in version
saying XmlConfigurator.ConfigureAndWatch() leaks resources if called
multiple times




The issue was fixed in version Please let us know if above memory
issue was related to the bug and it has been resolved in the next release. 


Any help would be greatly appreciated.




Best Regards,


Work: 972 409 5703 | Support: 972 400 0174 | Cell: 469 438 1396


Scanned by IBM Email Security Management Services powered by MessageLabs.
For more information please visit

View raw message