Hi I´m working on a project that uses Enterprice Libraries´s Unity container to resolve dependencies for exception handling, cache, logging and db access but we keep getting a lot of leaked objects into memory.
We are using property injection like this:
[Dependency]
public Database DB
{
get { return db; }
set { db = value; }
}
[Dependency]
public ExceptionManager ExceptionMgr
{
get { return exceptionManager; }
set { exceptionManager = value; }
}
Some of the object leaked:
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSetti
Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionPolicyData
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ReplaceHandlerData
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.WrapHandlerData Microsoft.Practices.EnterpriseLibrary.Common.Configuration.GenericEnumeratorWrapper Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerData Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings
Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheStorageData
Any general advice on handling dependencies with Unity to avoid object leaks?