{"action":"created","issue":{"url":"https://api.github.com/repos/tzinfo/tzinfo/issues/54","repository_url":"https://api.github.com/repos/tzinfo/tzinfo","labels_url":"https://api.github.com/repos/tzinfo/tzinfo/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/tzinfo/tzinfo/issues/54/comments","events_url":"https://api.github.com/repos/tzinfo/tzinfo/issues/54/events","html_url":"https://github.com/tzinfo/tzinfo/issues/54","id":174002431,"number":54,"title":"High memory consumption","user":{"login":"psienko","id":10990392,"avatar_url":"https://avatars.githubusercontent.com/u/10990392?v=3","gravatar_id":"","url":"https://api.github.com/users/psienko","html_url":"https://github.com/psienko","followers_url":"https://api.github.com/users/psienko/followers","following_url":"https://api.github.com/users/psienko/following{/other_user}","gists_url":"https://api.github.com/users/psienko/gists{/gist_id}","starred_url":"https://api.github.com/users/psienko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psienko/subscriptions","organizations_url":"https://api.github.com/users/psienko/orgs","repos_url":"https://api.github.com/users/psienko/repos","events_url":"https://api.github.com/users/psienko/events{/privacy}","received_events_url":"https://api.github.com/users/psienko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-30T12:10:05Z","updated_at":"2016-10-03T22:09:40Z","closed_at":"2016-10-03T21:22:40Z","body":"I have noticed that the tzinfo gem generate many string objects.\r\n\r\nLinks to problematic lines:\r\n* https://github.com/tzinfo/tzinfo/blob/master/lib/tzinfo/zoneinfo_timezone_info.rb#L131\r\n* https://github.com/tzinfo/tzinfo/blob/master/lib/tzinfo/zoneinfo_timezone_info.rb#L137\r\n* https://github.com/tzinfo/tzinfo/blob/master/lib/tzinfo/zoneinfo_timezone_info.rb#L143\r\n* https://github.com/tzinfo/tzinfo/blob/master/lib/tzinfo/zoneinfo_timezone_info.rb#L150\r\n\r\nMaybe good idea will be using freezing strings (e.g. 'NN'.freeze) or storing strings as constants.\r\n\r\nBelow are memory profiling results for one of request in my application\r\n\r\n###### Results before freezing strings:\r\n\r\nallocated memory by gem [bytes] | allocated objects by gem | allocated memory by class [bytes] | allocated objects by class\r\n--------------------------------- | --------------------------------| -----------------------------------|---------------------------------|\r\n    5519372  tzinfo-1.2.2 |     181142  tzinfo-1.2.2 |   29220995  String |     324131  String\r\n\r\n###### Results after freezing strings:\r\nallocated memory by gem [bytes] | allocated objects by gem | allocated memory by class [bytes] | allocated objects by class\r\n--------------------------------- | --------------------------------| -----------------------------------|---------------------------------|\r\n32160  tzinfo-1.2.2 |     1044  tzinfo-1.2.2 |   27375064  String |     263417  String\r\n"},"comment":{"url":"https://api.github.com/repos/tzinfo/tzinfo/issues/comments/251242066","html_url":"https://github.com/tzinfo/tzinfo/issues/54#issuecomment-251242066","issue_url":"https://api.github.com/repos/tzinfo/tzinfo/issues/54","id":251242066,"user":{"login":"philr","id":190067,"avatar_url":"https://avatars.githubusercontent.com/u/190067?v=3","gravatar_id":"","url":"https://api.github.com/users/philr","html_url":"https://github.com/philr","followers_url":"https://api.github.com/users/philr/followers","following_url":"https://api.github.com/users/philr/following{/other_user}","gists_url":"https://api.github.com/users/philr/gists{/gist_id}","starred_url":"https://api.github.com/users/philr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philr/subscriptions","organizations_url":"https://api.github.com/users/philr/orgs","repos_url":"https://api.github.com/users/philr/repos","events_url":"https://api.github.com/users/philr/events{/privacy}","received_events_url":"https://api.github.com/users/philr/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T22:09:40Z","updated_at":"2016-10-03T22:09:40Z","body":"Thank you for reporting this. A change to freeze the strings you have identified has been merged as part of #57."}}
{"actor":{"display_login":"philr"}}