{"action":"opened","issue":{"url":"https://api.github.com/repos/antfarmar/Unity-3D-Asteroids/issues/22","labels_url":"https://api.github.com/repos/antfarmar/Unity-3D-Asteroids/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/antfarmar/Unity-3D-Asteroids/issues/22/comments","events_url":"https://api.github.com/repos/antfarmar/Unity-3D-Asteroids/issues/22/events","html_url":"https://github.com/antfarmar/Unity-3D-Asteroids/issues/22","id":119402275,"number":22,"title":"String Usage: Memory Reduction","user":{"login":"antfarmar","id":15778096,"avatar_url":"https://avatars.githubusercontent.com/u/15778096?v=3","gravatar_id":"","url":"https://api.github.com/users/antfarmar","html_url":"https://github.com/antfarmar","followers_url":"https://api.github.com/users/antfarmar/followers","following_url":"https://api.github.com/users/antfarmar/following{/other_user}","gists_url":"https://api.github.com/users/antfarmar/gists{/gist_id}","starred_url":"https://api.github.com/users/antfarmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antfarmar/subscriptions","organizations_url":"https://api.github.com/users/antfarmar/orgs","repos_url":"https://api.github.com/users/antfarmar/repos","events_url":"https://api.github.com/users/antfarmar/events{/privacy}","received_events_url":"https://api.github.com/users/antfarmar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/antfarmar/Unity-3D-Asteroids/labels/design%20choice","name":"design choice","color":"207de5"},{"url":"https://api.github.com/repos/antfarmar/Unity-3D-Asteroids/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/antfarmar/Unity-3D-Asteroids/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-30T01:12:41Z","updated_at":"2015-11-30T01:12:41Z","closed_at":null,"body":"C# strings are immutable.\r\n\r\nHence, changing a string variable frequently (e.g. UI text for score) allocates memory at runtime and generates garbage which will invoke a GC call.\r\n\r\n* We can can do an explicit `GC.Collect()` call in between levels to clean all unreferenced memory.\r\n* We can use a mutable string of characters, as provided by the `StringBuilder` class in `System.Text`."}}