{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/11207","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/11207/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11207/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/11207/events","html_url":"https://github.com/JuliaLang/julia/issues/11207","id":74564087,"number":11207,"title":"stop using finalizers for resource management?","user":{"login":"JeffBezanson","id":744556,"avatar_url":"https://avatars.githubusercontent.com/u/744556?v=3","gravatar_id":"","url":"https://api.github.com/users/JeffBezanson","html_url":"https://github.com/JeffBezanson","followers_url":"https://api.github.com/users/JeffBezanson/followers","following_url":"https://api.github.com/users/JeffBezanson/following{/other_user}","gists_url":"https://api.github.com/users/JeffBezanson/gists{/gist_id}","starred_url":"https://api.github.com/users/JeffBezanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeffBezanson/subscriptions","organizations_url":"https://api.github.com/users/JeffBezanson/orgs","repos_url":"https://api.github.com/users/JeffBezanson/repos","events_url":"https://api.github.com/users/JeffBezanson/events{/privacy}","received_events_url":"https://api.github.com/users/JeffBezanson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/speculative","name":"speculative","color":"999999"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-05-09T02:39:38Z","updated_at":"2015-05-09T20:09:38Z","closed_at":null,"body":"Finalizers are inefficient and unpredictable. And with the new GC, it might take much longer to get around to freeing an object, therefore tying up its resources longer. Ideally releasing external resources should not be tied to how memory management works.\r\n\r\nWe are already not far from this with the `open(f) do` construct. I think that and/or `with` should be used. Perhaps there could be some other mechanism for registering files to close eventually.\r\n\r\nDiscussed this with @carnaval ."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/100539761","html_url":"https://github.com/JuliaLang/julia/issues/11207#issuecomment-100539761","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/11207","id":100539761,"user":{"login":"elextr","id":811085,"avatar_url":"https://avatars.githubusercontent.com/u/811085?v=3","gravatar_id":"","url":"https://api.github.com/users/elextr","html_url":"https://github.com/elextr","followers_url":"https://api.github.com/users/elextr/followers","following_url":"https://api.github.com/users/elextr/following{/other_user}","gists_url":"https://api.github.com/users/elextr/gists{/gist_id}","starred_url":"https://api.github.com/users/elextr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elextr/subscriptions","organizations_url":"https://api.github.com/users/elextr/orgs","repos_url":"https://api.github.com/users/elextr/repos","events_url":"https://api.github.com/users/elextr/events{/privacy}","received_events_url":"https://api.github.com/users/elextr/received_events","type":"User","site_admin":false},"created_at":"2015-05-09T20:09:38Z","updated_at":"2015-05-09T20:09:38Z","body":"@JeffBezanson how do you propose to handle objects whose lifetime exceeds the scope of the `with`, eg ones returned from the function?"}}