{"action":"created","issue":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1794","repository_url":"https://api.github.com/repos/AutoMapper/AutoMapper","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1794/labels{/name}","comments_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1794/comments","events_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1794/events","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1794","id":189666330,"number":1794,"title":"Performance issues and PreserveReferences not working correctly","user":{"login":"vukispasic","id":14116321,"avatar_url":"https://avatars.githubusercontent.com/u/14116321?v=3","gravatar_id":"","url":"https://api.github.com/users/vukispasic","html_url":"https://github.com/vukispasic","followers_url":"https://api.github.com/users/vukispasic/followers","following_url":"https://api.github.com/users/vukispasic/following{/other_user}","gists_url":"https://api.github.com/users/vukispasic/gists{/gist_id}","starred_url":"https://api.github.com/users/vukispasic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vukispasic/subscriptions","organizations_url":"https://api.github.com/users/vukispasic/orgs","repos_url":"https://api.github.com/users/vukispasic/repos","events_url":"https://api.github.com/users/vukispasic/events{/privacy}","received_events_url":"https://api.github.com/users/vukispasic/received_events","type":"User","site_admin":false},"labels":[{"id":92629237,"url":"https://api.github.com/repos/AutoMapper/AutoMapper/labels/Bug","name":"Bug","color":"e11d21","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/milestones/25","html_url":"https://github.com/AutoMapper/AutoMapper/milestone/25","labels_url":"https://api.github.com/repos/AutoMapper/AutoMapper/milestones/25/labels","id":2156205,"number":25,"title":"vNext","description":"","creator":{"login":"jbogard","id":104498,"avatar_url":"https://avatars.githubusercontent.com/u/104498?v=3","gravatar_id":"","url":"https://api.github.com/users/jbogard","html_url":"https://github.com/jbogard","followers_url":"https://api.github.com/users/jbogard/followers","following_url":"https://api.github.com/users/jbogard/following{/other_user}","gists_url":"https://api.github.com/users/jbogard/gists{/gist_id}","starred_url":"https://api.github.com/users/jbogard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbogard/subscriptions","organizations_url":"https://api.github.com/users/jbogard/orgs","repos_url":"https://api.github.com/users/jbogard/repos","events_url":"https://api.github.com/users/jbogard/events{/privacy}","received_events_url":"https://api.github.com/users/jbogard/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":26,"state":"open","created_at":"2016-11-24T15:09:28Z","updated_at":"2016-12-28T17:07:50Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2016-11-16T10:54:56Z","updated_at":"2016-12-28T17:55:28Z","closed_at":"2016-12-19T15:28:57Z","body":"We have been using AutoMapper 4.2.1 in our project to map our EF database model to DTO's which are 1-1 mapping. So our model has references in that way that child has reference to parent, same as parent has reference to children. Beside 1 to many relationship, we also have many to many relationship. After we upgraded AutoMapper to 5.1.1, we refactored code to use instance of IMapper which we create by calling config.CreateMappings() so no more usage of static methods from AutoMapper. We are experiencing stackoverflow exceptions. We applied PreserveReferences on each mapping in configuration, in order to get same behavior as with version 4.2.1 but we still get Stackoverflow in some cases. We also tried applying MaxDepth which helped in one case, but in another case we still get stackoverflow. My question is, if PreserveReferences should enable AutoMapper to track mapped objects using local hashtable, why doesn't it work in v5.1.1 if I enabled PreserveReferences  for every mapping configuration?\r\n\r\nEdit: Another issue we noticed is that mapping performance is much slower with either PreserveReferences   or MaxDepth(1) enabled then with AutoMapper 4.2.1"},"comment":{"url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/comments/269514034","html_url":"https://github.com/AutoMapper/AutoMapper/issues/1794#issuecomment-269514034","issue_url":"https://api.github.com/repos/AutoMapper/AutoMapper/issues/1794","id":269514034,"user":{"login":"jbogard","id":104498,"avatar_url":"https://avatars.githubusercontent.com/u/104498?v=3","gravatar_id":"","url":"https://api.github.com/users/jbogard","html_url":"https://github.com/jbogard","followers_url":"https://api.github.com/users/jbogard/followers","following_url":"https://api.github.com/users/jbogard/following{/other_user}","gists_url":"https://api.github.com/users/jbogard/gists{/gist_id}","starred_url":"https://api.github.com/users/jbogard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbogard/subscriptions","organizations_url":"https://api.github.com/users/jbogard/orgs","repos_url":"https://api.github.com/users/jbogard/repos","events_url":"https://api.github.com/users/jbogard/events{/privacy}","received_events_url":"https://api.github.com/users/jbogard/received_events","type":"User","site_admin":false},"created_at":"2016-12-28T17:55:28Z","updated_at":"2016-12-28T17:55:28Z","body":"Can you at least nail down which particular mapping is causing the issue? And build out the example using that? It's just impossible to fix without some way of trying to reproduce it."}}
{"actor":{"display_login":"jbogard"}}