{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/router/issues/207","labels_url":"https://api.github.com/repos/aurelia/router/issues/207/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/router/issues/207/comments","events_url":"https://api.github.com/repos/aurelia/router/issues/207/events","html_url":"https://github.com/aurelia/router/issues/207","id":104927033,"number":207,"title":"memory leak in router","user":{"login":"reinholdk","id":12561459,"avatar_url":"https://avatars.githubusercontent.com/u/12561459?v=3","gravatar_id":"","url":"https://api.github.com/users/reinholdk","html_url":"https://github.com/reinholdk","followers_url":"https://api.github.com/users/reinholdk/followers","following_url":"https://api.github.com/users/reinholdk/following{/other_user}","gists_url":"https://api.github.com/users/reinholdk/gists{/gist_id}","starred_url":"https://api.github.com/users/reinholdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reinholdk/subscriptions","organizations_url":"https://api.github.com/users/reinholdk/orgs","repos_url":"https://api.github.com/users/reinholdk/repos","events_url":"https://api.github.com/users/reinholdk/events{/privacy}","received_events_url":"https://api.github.com/users/reinholdk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aurelia/router/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-04T16:47:37Z","updated_at":"2015-09-14T06:21:08Z","closed_at":null,"body":"I have a scenario with router and child router which leads to a memory leak. View models instantiated by the child router are still being referenced when navigating away.\r\nI have built the scenario in the following Plunker [http://embed.plnkr.co/n5W1JA/preview].\r\nThe child router is part of the view model called \"second\". It allows to toggle between two view models, \"child1\" and \"child2\".\r\nThe leak can be observed by navigating to the \"second\" view and toggling between \"child1\" and \"child2\".\r\nEach navigation to \"child1\" creates an new instance of the view model. A heap snapshot reveals that the instances of the view model do not get cleaned-up, even when navigating to the other top-level view \"first\".\r\nFor easy lookup in the heap snapshot, child1 initializes a property with an instance of a class called \"LeakTag\".  So just filter the snapshot for that class and you'll see the growing number of instances."},"comment":{"url":"https://api.github.com/repos/aurelia/router/issues/comments/139973091","html_url":"https://github.com/aurelia/router/issues/207#issuecomment-139973091","issue_url":"https://api.github.com/repos/aurelia/router/issues/207","id":139973091,"user":{"login":"reinholdk","id":12561459,"avatar_url":"https://avatars.githubusercontent.com/u/12561459?v=3","gravatar_id":"","url":"https://api.github.com/users/reinholdk","html_url":"https://github.com/reinholdk","followers_url":"https://api.github.com/users/reinholdk/followers","following_url":"https://api.github.com/users/reinholdk/following{/other_user}","gists_url":"https://api.github.com/users/reinholdk/gists{/gist_id}","starred_url":"https://api.github.com/users/reinholdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reinholdk/subscriptions","organizations_url":"https://api.github.com/users/reinholdk/orgs","repos_url":"https://api.github.com/users/reinholdk/repos","events_url":"https://api.github.com/users/reinholdk/events{/privacy}","received_events_url":"https://api.github.com/users/reinholdk/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T06:21:08Z","updated_at":"2015-09-14T06:21:08Z","body":"Strange, I can still see the plunk even when not logged-in to Plunker, it is marked as public plunk.\r\nThis is the editor URL exposed when pressing the share as e-mail button: http://plnkr.co/edit/n5W1JA?p=info maybe it works better."}}