| Author |
Message |
purplesoup
Joined: 24 Sep 2012 Posts: 1
|
Posted: Mon Sep 24, 2012 11:02 am Post subject: log4net memory leak? |
|
|
We have an ASP.NET website where the memory isn't getting released.
I've been looking at my ANTS profiler information and seen calls from System.Web.NativeFileChangeNotification and also System.Threading.TimerCallback.
Searching on TimerCallback in our code comes up with a log4net file DOMConfigurator with the code below. Has anyone had any problems with log4net not releasing memory?
internal ConfigureAndWatchHandler(ILoggerRepository repository, FileInfo configFile)
{
m_repository = repository;
m_configFile = configFile;
// Create a new FileSystemWatcher and set its properties.
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = m_configFile.DirectoryName;
watcher.Filter = m_configFile.Name;
// Set the notification filters
watcher.NotifyFilter = NotifyFilters.CreationTime | NotifyFilters.LastWrite | NotifyFilters.FileName;
// Add event handlers. OnChanged will do for all event handlers that fire a FileSystemEventArgs
watcher.Changed += new FileSystemEventHandler(ConfigureAndWatchHandler_OnChanged);
watcher.Created += new FileSystemEventHandler(ConfigureAndWatchHandler_OnChanged);
watcher.Deleted += new FileSystemEventHandler(ConfigureAndWatchHandler_OnChanged);
watcher.Renamed += new RenamedEventHandler(ConfigureAndWatchHandler_OnRenamed);
// Begin watching.
watcher.EnableRaisingEvents = true;
// Create the timer that will be used to deliver events. Set as disabled
m_timer = new Timer(new TimerCallback(OnWhatchedFileChange), null, Timeout.Infinite, Timeout.Infinite);
} |
|
| Back to top |
|
 |
Chris.Allen
Joined: 12 Mar 2009 Posts: 443
|
Posted: Wed Dec 12, 2012 3:51 pm Post subject: |
|
|
| The memory profiler should be able to tell you which objects are in memory and why- can you take several snapshots and try to identify objects that should not still be in memory? If log4net classes are leaking memory- this will show up well in the results which you can always send to us in support@red-gate.com |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group