community-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yuvraj Raj <>
Subject log4net.dll version (FileSystemWatcher objects)
Date Wed, 22 May 2013 21:57:25 GMT

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

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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message