#c# memory optimization for games