This project has moved. For the latest updates, please go here.
1

Closed

Memory Issues with AutoMapper

description

I am using automapper in my prism application to Map the Data Access Entities to Business Layer Entities. But its seems to be consuming a lot of memory.
public EMRBusinessLogic(IUnityContainer container, IRegionManager regionManager)
    {
        this.regionManager = regionManager;
        this.container = container;
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.AnatomicStructure, AnatomicStructure>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.Encounter, Encounter>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.EntityBase, EntityBase>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.ExamFinding, ExamFinding>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.MedicalNote, MedicalNote>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.PatientExamFinding, PatientExamFinding>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.PatientExamStructure, PatientExamStructure>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.AnatomicStructureType, AnatomicStructureType>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.EncounterStatus, EncounterStatus>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.FindingLaterality, FindingLaterality>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.MedicalNoteStatus, MedicalNoteStatus>();
        Mapper.CreateMap<VCA.Sparky.DataAccess.EMR.Sex, Sex>();
    }
public List<AnatomicStructure> GetAnatomicStructure()
    {
        var ienumerableDest = Mapper.Map<List<DataAccess.EMR.AnatomicStructure>, List<AnatomicStructure>>(ExamFindingDataManager.GetAllTopAnatomicStructures());
        return ienumerableDest;
    }
Whats the issue in this. The Automapper is not disposing it seems to be in the memory with a lot of live intances.
Closed May 8, 2014 at 2:19 PM by jbogard

comments